Manjushri commited on
Commit
d2ef8ad
·
verified ·
1 Parent(s): 7bb64ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -349,10 +349,16 @@ 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
-
 
 
 
 
 
 
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'], value='PhotoReal', label='Choose Model'),
356
  gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
357
  gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
358
  gr.Slider(512, 1280, 768, step=128, label='Height'),
 
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
+ if Model == 'Cascade':
354
+ from diffusers import StableCascadeCombinedPipeline
355
+ pipe = StableCascadeCombinedPipeline.from_pretrained("stabilityai/stable-cascade", variant="bf16", torch_dtype=torch.bfloat16)
356
+ image = (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]
357
+ return image
358
+
359
  return image
360
 
361
+ gr.Interface(fn=genie, inputs=[gr.Radio(['PhotoReal', 'Anime', 'Disney', 'StoryBook', 'SemiReal', 'Animagine XL 3.0', 'SDXL 1.0', 'FusionXL', 'Cascade'], value='PhotoReal', label='Choose Model'),
362
  gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
363
  gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
364
  gr.Slider(512, 1280, 768, step=128, label='Height'),