Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -165,67 +165,64 @@ examples = [
|
|
165 |
with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
|
166 |
gr.HTML("<h1><center>SD3M🐉T5</center></h1>")
|
167 |
gr.HTML("<p><center><a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>sd3m</a> text/image-to-image generation<br><b>Update</b>: fix diffuser to support 512 token</center></p>")
|
168 |
-
with gr.
|
169 |
-
with gr.
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
value=1,
|
227 |
-
scale=1,
|
228 |
-
)
|
229 |
gr.Examples(
|
230 |
examples=examples,
|
231 |
inputs=prompt,
|
|
|
165 |
with gr.Blocks(css=CSS, js=JS, theme="soft") as demo:
|
166 |
gr.HTML("<h1><center>SD3M🐉T5</center></h1>")
|
167 |
gr.HTML("<p><center><a href='https://huggingface.co/stabilityai/stable-diffusion-3-medium'>sd3m</a> text/image-to-image generation<br><b>Update</b>: fix diffuser to support 512 token</center></p>")
|
168 |
+
with gr.Row():
|
169 |
+
with gr.Column(scale=10):
|
170 |
+
img = gr.Gallery(label='SD3M Generated Image', columns = 1, preview=True, height=600)
|
171 |
+
prompt = gr.MultimodalTextbox(label='Enter Your Prompt (Multi-Languages)', interactive=True, placeholder="Enter prompt, add one image.", file_types=['image'])
|
172 |
+
with gr.Accordion("Advanced Options", open=False):
|
173 |
+
with gr.Column(scale=1):
|
174 |
+
negative = gr.Textbox(label="Negative prompt", value="low quality, ugly, blurry, poor face, bad anatomy")
|
175 |
+
width = gr.Slider(
|
176 |
+
label="Width",
|
177 |
+
minimum=512,
|
178 |
+
maximum=1280,
|
179 |
+
step=8,
|
180 |
+
value=1024,
|
181 |
+
)
|
182 |
+
height = gr.Slider(
|
183 |
+
label="Height",
|
184 |
+
minimum=512,
|
185 |
+
maximum=1280,
|
186 |
+
step=8,
|
187 |
+
value=1024,
|
188 |
+
)
|
189 |
+
scales = gr.Slider(
|
190 |
+
label="Guidance",
|
191 |
+
minimum=3.5,
|
192 |
+
maximum=7,
|
193 |
+
step=0.1,
|
194 |
+
value=5,
|
195 |
+
)
|
196 |
+
steps = gr.Slider(
|
197 |
+
label="Steps",
|
198 |
+
minimum=1,
|
199 |
+
maximum=50,
|
200 |
+
step=1,
|
201 |
+
value=30,
|
202 |
+
)
|
203 |
+
strength = gr.Slider(
|
204 |
+
label="Strength",
|
205 |
+
minimum=0.0,
|
206 |
+
maximum=1.0,
|
207 |
+
step=0.1,
|
208 |
+
value=0.7,
|
209 |
+
)
|
210 |
+
seed = gr.Slider(
|
211 |
+
label="Seed (-1 Get Random)",
|
212 |
+
minimum=-1,
|
213 |
+
maximum=MAX_SEED,
|
214 |
+
step=1,
|
215 |
+
value=-1,
|
216 |
+
scale=2,
|
217 |
+
)
|
218 |
+
nums = gr.Slider(
|
219 |
+
label="Image Numbers",
|
220 |
+
minimum=1,
|
221 |
+
maximum=4,
|
222 |
+
step=1,
|
223 |
+
value=1,
|
224 |
+
scale=1,
|
225 |
+
)
|
|
|
|
|
|
|
226 |
gr.Examples(
|
227 |
examples=examples,
|
228 |
inputs=prompt,
|