Manjushri commited on
Commit
d00f6d2
·
verified ·
1 Parent(s): fb73fa2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 = refiner.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 = refiner(Prompt, negative_prompt=negative_prompt, image=image, denoising_start=high_noise_frac).images[0]
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: