Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ neg_prompt_2 = " 'non-photorealistic':1.5, 'unrealistic skin','unattractive face
|
|
| 81 |
|
| 82 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 83 |
|
| 84 |
-
upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("
|
| 85 |
|
| 86 |
def load_and_prepare_model():
|
| 87 |
vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False) #.to(device=device, dtype=torch.bfloat16)
|
|
@@ -228,8 +228,8 @@ def generate(
|
|
| 228 |
if segment==8:
|
| 229 |
final_latents = current_latents
|
| 230 |
final_latents = final_latents / pipe.vae.config.scaling_factor
|
| 231 |
-
with torch.no_grad():
|
| 232 |
-
|
| 233 |
image = pipe.image_processor.postprocess(image, output_type="pil")[0]
|
| 234 |
output_image_file = f"rv_L_{seed}.png"
|
| 235 |
image.save(output_image_file)
|
|
|
|
| 81 |
|
| 82 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 83 |
|
| 84 |
+
upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cpu"))
|
| 85 |
|
| 86 |
def load_and_prepare_model():
|
| 87 |
vaeXL = AutoencoderKL.from_pretrained("stabilityai/sdxl-vae", safety_checker=None, use_safetensors=False) #.to(device=device, dtype=torch.bfloat16)
|
|
|
|
| 228 |
if segment==8:
|
| 229 |
final_latents = current_latents
|
| 230 |
final_latents = final_latents / pipe.vae.config.scaling_factor
|
| 231 |
+
#with torch.no_grad():
|
| 232 |
+
image = pipe.vae.decode(final_latents, return_dict=False)[0]
|
| 233 |
image = pipe.image_processor.postprocess(image, output_type="pil")[0]
|
| 234 |
output_image_file = f"rv_L_{seed}.png"
|
| 235 |
image.save(output_image_file)
|