Manjushri commited on
Commit
38fc527
1 Parent(s): 42c60b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -19
app.py CHANGED
@@ -349,25 +349,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed, re
349
  image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale).images[0]
350
  torch.cuda.empty_cache()
351
  return image
352
- if Model == 'CascadeXL':
353
- torch.cuda.empty_cache()
354
- from diffusers import StableCascadeCombinedPipeline
355
- pipe = StableCascadeCombinedPipeline.from_pretrained("stabilityai/stable-cascade", torch_dtype=torch.float16)
356
- pipe.enable_xformers_memory_efficient_attention()
357
- pipe = pipe.to(device)
358
- image = pipe(prompt=Prompt, negative_prompt=negative_prompt, num_inference_steps=10, prior_num_inference_steps=20, prior_guidance_scale=3.0, width=width, height=height).images[0]
359
-
360
- if upscale == 'Yes':
361
- torch.cuda.empty_cache()
362
- upscaler = DiffusionPipeline.from_pretrained("stabilityai/sd-x2-latent-upscaler", torch_dtype=torch.float16, use_safetensors=True)
363
- upscaler.enable_xformers_memory_efficient_attention()
364
- upscaler = upscaler.to(device)
365
- torch.cuda.empty_cache()
366
- upscaled = upscaler(prompt=Prompt, negative_prompt=negative_prompt, image=image, num_inference_steps=5, guidance_scale=0).images[0]
367
- return upscaled
368
- else:
369
- return image
370
-
371
  return image
372
 
373
  gr.Interface(fn=genie, inputs=[gr.Radio(['PhotoReal', 'Anime', 'Disney', 'StoryBook', 'SemiReal', 'Animagine XL 3.0', 'SDXL 1.0', 'FusionXL', 'CascadeXL'], value='PhotoReal', label='Choose Model'),
 
349
  image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale).images[0]
350
  torch.cuda.empty_cache()
351
  return image
352
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  return image
354
 
355
  gr.Interface(fn=genie, inputs=[gr.Radio(['PhotoReal', 'Anime', 'Disney', 'StoryBook', 'SemiReal', 'Animagine XL 3.0', 'SDXL 1.0', 'FusionXL', 'CascadeXL'], value='PhotoReal', label='Choose Model'),