Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -317,11 +317,11 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
317 |
image = pipe(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=high_noise_frac).images[0]
|
318 |
torch.cuda.empty_cache()
|
319 |
if upscale == "Yes":
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
torch.cuda.empty_cache()
|
324 |
-
upscaled =
|
325 |
torch.cuda.empty_cache()
|
326 |
return upscaled
|
327 |
else:
|
|
|
317 |
image = pipe(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=high_noise_frac).images[0]
|
318 |
torch.cuda.empty_cache()
|
319 |
if upscale == "Yes":
|
320 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/sd-x2-latent-upscaler", torch_dtype=torch.float16, use_safetensors=True)
|
321 |
+
pipe.enable_xformers_memory_efficient_attention()
|
322 |
+
pipe = pipe.to(device)
|
323 |
torch.cuda.empty_cache()
|
324 |
+
upscaled = pipe(prompt=Prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
|
325 |
torch.cuda.empty_cache()
|
326 |
return upscaled
|
327 |
else:
|