Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -308,11 +308,12 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
|
|
308 |
pipe = pipe.to(device)
|
309 |
torch.cuda.empty_cache()
|
310 |
if refine == "Yes":
|
311 |
-
refiner = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16") if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0")
|
312 |
-
refiner.enable_xformers_memory_efficient_attention()
|
313 |
-
refiner = refiner.to(device)
|
314 |
-
torch.cuda.empty_cache()
|
315 |
int_image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
|
|
|
|
|
|
|
|
|
|
316 |
image = refiner(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=high_noise_frac).images[0]
|
317 |
torch.cuda.empty_cache()
|
318 |
if upscale == "Yes":
|
|
|
308 |
pipe = pipe.to(device)
|
309 |
torch.cuda.empty_cache()
|
310 |
if refine == "Yes":
|
|
|
|
|
|
|
|
|
311 |
int_image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
312 |
+
|
313 |
+
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16") if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0")
|
314 |
+
pipe.enable_xformers_memory_efficient_attention()
|
315 |
+
pipe = pipe.to(device)
|
316 |
+
torch.cuda.empty_cache()
|
317 |
image = refiner(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=high_noise_frac).images[0]
|
318 |
torch.cuda.empty_cache()
|
319 |
if upscale == "Yes":
|