Manjushri commited on
Commit
934504b
1 Parent(s): c24bef3

Update app.py

Browse files

Updates to GUI, Labels, and descriptions

Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -9,14 +9,16 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
9
  pipe = DiffusionPipeline.from_pretrained("prompthero/openjourney-v2", torch_dtype=torch.float16, safety_checker=None)
10
  pipe = pipe.to(device)
11
 
12
- def genie (prompt, scale, steps, seed):
13
- generator = torch.Generator(device=device).manual_seed(seed)
14
  images = pipe(prompt, num_inference_steps=steps, guidance_scale=scale, generator=generator).images[0]
15
  return images
16
 
17
  gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
18
- gr.Slider(1, maximum=15, value=10, step=.25),
19
- gr.Slider(1, maximum=100, value=50, step=1),
20
- gr.Slider(minimum=1, step=1, maximum=987654321, randomize=True)],
21
- outputs='image', title="OpenJourney V2 GPU", description="OJ V2 GPU.",
 
 
22
  article = "Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=True)
 
9
  pipe = DiffusionPipeline.from_pretrained("prompthero/openjourney-v2", torch_dtype=torch.float16, safety_checker=None)
10
  pipe = pipe.to(device)
11
 
12
+ def genie (prompt, scale, steps, Seed):
13
+ generator = torch.Generator(device=device).manual_seed(Seed)
14
  images = pipe(prompt, num_inference_steps=steps, guidance_scale=scale, generator=generator).images[0]
15
  return images
16
 
17
  gr.Interface(fn=genie, inputs=[gr.Textbox(label='What you want the AI to generate. 77 Token Limit.'),
18
+ gr.Slider(1, maximum=15, value=10, step=.25, label='Prompt Guidance Scale:', interactive=True),
19
+ gr.Slider(1, maximum=100, value=50, step=1, label='Number of Iterations: 50 is typically fine.'),
20
+ gr.Slider(minimum=1, step=1, maximum=987654321, randomize=True, interactive=True)],
21
+ outputs=gr.Image(label='512x512 Generated Image'),
22
+ title="OpenJourney V2 GPU",
23
+ description="OJ V2 GPU. Ultra Fast, now running on a T4",
24
  article = "Code Monkey: <a href=\"https://huggingface.co/Manjushri\">Manjushri</a>").launch(debug=True, max_threads=True)