Manjushri commited on
Commit
70d3329
1 Parent(s): ed90ec2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -116,12 +116,12 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, up
116
  torch.cuda.empty_cache()
117
 
118
  if upscale == "Yes":
119
- int_image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
120
  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")
121
  sdxl.enable_xformers_memory_efficient_attention()
122
  sdxl = sdxl.to(device)
123
  torch.cuda.empty_cache()
124
- refined = sdxl(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=high_noise_frac).images[0]
125
  torch.cuda.empty_cache()
126
  return refined
127
  else:
 
116
  torch.cuda.empty_cache()
117
 
118
  if upscale == "Yes":
119
+ image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
120
  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")
121
  sdxl.enable_xformers_memory_efficient_attention()
122
  sdxl = sdxl.to(device)
123
  torch.cuda.empty_cache()
124
+ refined = sdxl(Prompt, negative_prompt=negative_prompt, image=image, denoising_start=high_noise_frac).images[0]
125
  torch.cuda.empty_cache()
126
  return refined
127
  else: