Manjushri commited on
Commit
7325dc7
·
verified ·
1 Parent(s): 6312a59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -28,15 +28,15 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
28
  torch.cuda.empty_cache()
29
 
30
  if upscale == "Yes":
31
- upscaler = DiffusionPipeline.from_pretrained("stabilityai/sd-x2-latent-upscaler", torch_dtype=torch.float16, use_safetensors=True)
32
- upscaler.enable_xformers_memory_efficient_attention()
33
- upscaler = upscaler.to(device)
34
- torch.cuda.empty_cache()
35
- upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
36
- torch.cuda.empty_cache()
37
- return upscaled
38
- else:
39
- return image
40
  else:
41
  image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale).images[0]
42
  torch.cuda.empty_cache()
 
28
  torch.cuda.empty_cache()
29
 
30
  if upscale == "Yes":
31
+ upscaler = DiffusionPipeline.from_pretrained("stabilityai/sd-x2-latent-upscaler", torch_dtype=torch.float16, use_safetensors=True)
32
+ upscaler.enable_xformers_memory_efficient_attention()
33
+ upscaler = upscaler.to(device)
34
+ torch.cuda.empty_cache()
35
+ upscaled = upscaler(prompt=prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=15, guidance_scale=0).images[0]
36
+ torch.cuda.empty_cache()
37
+ return upscaled
38
+ else:
39
+ return image
40
  else:
41
  image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale).images[0]
42
  torch.cuda.empty_cache()