Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -43,113 +43,53 @@ def infer(prompt,
|
|
43 |
).images[0]
|
44 |
|
45 |
return image, seed
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
"""
|
69 |
-
)
|
70 |
-
gr.HTML(
|
71 |
-
"""
|
72 |
-
<h3 style='text-align: center'>
|
73 |
-
Follow me for more!
|
74 |
-
<a href='https://twitter.com/kadirnar_ai' target='_blank'>Twitter</a> | <a href='https://github.com/kadirnar' target='_blank'>Github</a> | <a href='https://www.linkedin.com/in/kadir-nar/' target='_blank'>Linkedin</a> | <a href='https://www.huggingface.co/kadirnar/' target='_blank'>HuggingFace</a>
|
75 |
-
</h3>
|
76 |
-
"""
|
77 |
-
)
|
78 |
-
|
79 |
-
with gr.Row():
|
80 |
-
prompt = gr.Text(
|
81 |
-
label="Prompt",
|
82 |
-
show_label=False,
|
83 |
-
max_lines=1,
|
84 |
-
placeholder="Enter your prompt",
|
85 |
-
container=False,
|
86 |
-
)
|
87 |
-
run_button = gr.Button("Run", scale=0)
|
88 |
-
|
89 |
-
result = gr.Image(label="Result", show_label=False)
|
90 |
-
|
91 |
-
with gr.Accordion("Advanced Settings", open=False):
|
92 |
-
negative_prompt = gr.Text(
|
93 |
-
label="Negative prompt",
|
94 |
-
max_lines=1,
|
95 |
-
placeholder="Enter a negative prompt",
|
96 |
-
)
|
97 |
-
|
98 |
-
seed = gr.Slider(
|
99 |
-
label="Seed",
|
100 |
-
minimum=0,
|
101 |
-
maximum=MAX_SEED,
|
102 |
-
step=1,
|
103 |
-
value=0,
|
104 |
-
)
|
105 |
-
|
106 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
maximum=MAX_IMAGE_SIZE,
|
113 |
-
step=32,
|
114 |
-
value=1024,
|
115 |
-
)
|
116 |
-
height = gr.Slider(
|
117 |
-
label="Height",
|
118 |
-
minimum=256,
|
119 |
-
maximum=MAX_IMAGE_SIZE,
|
120 |
-
step=32,
|
121 |
-
value=1024,
|
122 |
-
)
|
123 |
-
|
124 |
-
with gr.Row():
|
125 |
-
guidance_scale = gr.Slider(
|
126 |
-
label="Guidance scale",
|
127 |
-
minimum=0.0,
|
128 |
-
maximum=10.0,
|
129 |
-
step=0.1,
|
130 |
-
value=5.0,
|
131 |
-
)
|
132 |
-
num_inference_steps = gr.Slider(
|
133 |
-
label="Number of inference steps",
|
134 |
-
minimum=1,
|
135 |
-
maximum=50,
|
136 |
-
step=1,
|
137 |
-
value=28,
|
138 |
-
)
|
139 |
-
|
140 |
-
gr.Examples(
|
141 |
-
examples=examples,
|
142 |
-
fn=infer,
|
143 |
-
inputs=[prompt],
|
144 |
-
outputs=[result, seed],
|
145 |
-
cache_examples="lazy"
|
146 |
-
)
|
147 |
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
150 |
fn=infer,
|
151 |
inputs=[prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
152 |
-
outputs=[result,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
)
|
154 |
|
155 |
-
demo.queue().launch()
|
|
|
43 |
).images[0]
|
44 |
|
45 |
return image, seed
|
46 |
+
with gr.Blocks(theme=gr.themes.Default()) as demo:
|
47 |
+
gr.HTML(
|
48 |
+
"""
|
49 |
+
<h1 style='text-align: center'>
|
50 |
+
AuraFlow v0.3
|
51 |
+
</h1>
|
52 |
+
"""
|
53 |
+
)
|
54 |
+
gr.HTML(
|
55 |
+
"""
|
56 |
+
<h3 style='text-align: center'>
|
57 |
+
Follow me for more!
|
58 |
+
<a href='https://twitter.com/kadirnar_ai' target='_blank'>Twitter</a> | <a href='https://github.com/kadirnar' target='_blank'>Github</a> | <a href='https://www.linkedin.com/in/kadir-nar/' target='_blank'>Linkedin</a> | <a href='https://www.huggingface.co/kadirnar/' target='_blank'>HuggingFace</a>
|
59 |
+
</h3>
|
60 |
+
"""
|
61 |
+
)
|
62 |
+
|
63 |
+
with gr.Row():
|
64 |
+
with gr.Column(scale=1):
|
65 |
+
prompt = gr.Text(label="Prompt", placeholder="Enter your prompt")
|
66 |
+
negative_prompt = gr.Text(label="Negative prompt", placeholder="Enter a negative prompt")
|
67 |
+
seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
69 |
+
width = gr.Slider(label="Width", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
|
70 |
+
height = gr.Slider(label="Height", minimum=256, maximum=MAX_IMAGE_SIZE, step=32, value=1024)
|
71 |
+
guidance_scale = gr.Slider(label="Guidance scale", minimum=0.0, maximum=10.0, step=0.1, value=5.0)
|
72 |
+
num_inference_steps = gr.Slider(label="Number of inference steps", minimum=1, maximum=50, step=1, value=28)
|
73 |
+
run_button = gr.Button("Generate")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
+
with gr.Column(scale=1):
|
76 |
+
result = gr.Image(label="Generated Image")
|
77 |
+
seed_output = gr.Number(label="Seed used")
|
78 |
+
|
79 |
+
run_button.click(
|
80 |
fn=infer,
|
81 |
inputs=[prompt, negative_prompt, seed, randomize_seed, width, height, guidance_scale, num_inference_steps],
|
82 |
+
outputs=[result, seed_output]
|
83 |
+
)
|
84 |
+
|
85 |
+
gr.Examples(
|
86 |
+
examples=[
|
87 |
+
"A photo of a lavender cat",
|
88 |
+
"Astronaut in a jungle, cold color palette, muted colors, detailed, 8k",
|
89 |
+
"An astronaut riding a green horse",
|
90 |
+
"A delicious ceviche cheesecake slice",
|
91 |
+
],
|
92 |
+
inputs=prompt,
|
93 |
)
|
94 |
|
95 |
+
demo.queue().launch(server_name="0.0.0.0", share=False)
|