Update app.py
Browse filesUpdates to GUI, Labels, and descriptions
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,
|
13 |
-
generator = torch.Generator(device=device).manual_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='
|
|
|
|
|
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)
|