Manjushri commited on
Commit
b7b4dfa
·
verified ·
1 Parent(s): 2d7fd47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -120,11 +120,8 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, up
120
  torch.cuda.empty_cache()
121
  torch.cuda.max_memory_allocated(device=device)
122
  image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
123
- 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")
124
- sdxl.enable_xformers_memory_efficient_attention()
125
- sdxl = sdxl.to(device)
126
  torch.cuda.empty_cache()
127
- refined = sdxl(Prompt, negative_prompt=negative_prompt, image=image, denoising_start=high_noise_frac).images[0]
128
  torch.cuda.empty_cache()
129
  return refined
130
  else:
 
120
  torch.cuda.empty_cache()
121
  torch.cuda.max_memory_allocated(device=device)
122
  image = sdxl(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
 
 
 
123
  torch.cuda.empty_cache()
124
+ refined = refiner(Prompt, negative_prompt=negative_prompt, image=image, denoising_start=high_noise_frac).images[0]
125
  torch.cuda.empty_cache()
126
  return refined
127
  else: