Spaces:
Running
on
T4
Running
on
T4
Update app.py
Browse files
app.py
CHANGED
@@ -139,11 +139,11 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, up
|
|
139 |
torch.cuda.empty_cache()
|
140 |
sdxl = 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")
|
141 |
sdxl.enable_xformers_memory_efficient_attention()
|
142 |
-
sdxl =
|
143 |
torch.cuda.empty_cache()
|
144 |
image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
145 |
torch.cuda.empty_cache()
|
146 |
-
refined =
|
147 |
torch.cuda.empty_cache()
|
148 |
return refined
|
149 |
else:
|
|
|
139 |
torch.cuda.empty_cache()
|
140 |
sdxl = 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")
|
141 |
sdxl.enable_xformers_memory_efficient_attention()
|
142 |
+
sdxl = sdxl.to(device)
|
143 |
torch.cuda.empty_cache()
|
144 |
image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
|
145 |
torch.cuda.empty_cache()
|
146 |
+
refined = sdxl(Prompt, negative_prompt=negative_prompt, image=image, denoising_start=high_noise_frac).images[0]
|
147 |
torch.cuda.empty_cache()
|
148 |
return refined
|
149 |
else:
|