Manjushri commited on
Commit
b32943f
1 Parent(s): d5fa67e

Update app.py

Browse files

Added Bells and Whistles

Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -11,7 +11,7 @@ upscaler = StableDiffusionLatentUpscalePipeline.from_pretrained("stabilityai/sd-
11
  upscaler = upscaler.to(device)
12
  pipe = pipe.to(device)
13
 
14
- def genie (Prompt, negative_prompt, scale, steps, Seed, upscale, upscale_iter):
15
  generator = torch.Generator(device=device).manual_seed(Seed)
16
  if upscale == "Yes":
17
  low_res_latents = pipe(Prompt, negative_prompt=negative_prompt, num_inference_steps=steps, guidance_scale=scale, generator=generator, output_type="latent").images
@@ -22,12 +22,17 @@ def genie (Prompt, negative_prompt, scale, steps, Seed, upscale, upscale_iter):
22
 
23
  gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
24
  gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
25
- gr.Slider(minimum=1, maximum=15, value=10, step=.25, label='Prompt Guidance Scale:', interactive=True),
26
- gr.Slider(minimum=1, maximum=100, value=50, step=1, label='Number of Iterations: 50 is typically fine.'),
27
- gr.Slider(minimum=1, step=10, maximum=999999999999999999, randomize=True, interactive=True),
 
 
28
  gr.Radio(["Yes", "No"], label='Upscale?'),
29
- gr.Slider(minimum=5, maximum=25,value=5, step=5, label='Upscaler Iterations'),
30
-
 
 
 
31
  ],
32
  outputs=gr.Image(label='Generated Image'),
33
  title="PhotoReal V2 with SD x2 Upscaler - GPU",
 
11
  upscaler = upscaler.to(device)
12
  pipe = pipe.to(device)
13
 
14
+ def genie (Prompt, negative_prompt, height, width, scale, steps, seed, upscale, upscale_prompt, upscale_neg, upscale_scale, upscale_steps):
15
  generator = torch.Generator(device=device).manual_seed(Seed)
16
  if upscale == "Yes":
17
  low_res_latents = pipe(Prompt, negative_prompt=negative_prompt, num_inference_steps=steps, guidance_scale=scale, generator=generator, output_type="latent").images
 
22
 
23
  gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
24
  gr.Textbox(label='What you Do Not want the AI to generate. 77 Token Limit'),
25
+ gr.Slider(512, 1024, 768, step=128, label='Height'),
26
+ gr.Slider(512, 1024, 768, step=128, label='Width'),
27
+ gr.Slider(1, maximum=15, value=10, step=.25),
28
+ gr.Slider(25, maximum=100, value=50, step=25),
29
+ gr.Slider(minimum=1, step=1, maximum=9999999999999999, randomize=True),
30
  gr.Radio(["Yes", "No"], label='Upscale?'),
31
+ gr.Textbox(label='Upscaler Prompt: Optional'),
32
+ gr.Textbox(label='Upscaler Negative Prompt: Both Optional And Experimental'),
33
+ gr.Slider(minimum=0, maximum=15, value=0, step=1, label='Upscale Guidance Scale'),
34
+ gr.Slider(minimum=5, maximum=25, value=5, step=5, label='Upscaler Iterations')],
35
+
36
  ],
37
  outputs=gr.Image(label='Generated Image'),
38
  title="PhotoReal V2 with SD x2 Upscaler - GPU",