Spaces:
vilarin
/
Running on Zero

vilarin commited on
Commit
db04c05
1 Parent(s): f7eaa68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -61
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.Group():
169
- with gr.Row():
170
- prompt = gr.MultimodalTextbox(label='Enter Your Prompt (Multi-Languages)', interactive=True, placeholder="Enter prompt, add one image.", file_types=['image'], scale=1)
171
- img = gr.Gallery(label='SD3M Generated Image',columns = 1, preview=True)
172
- with gr.Accordion("Advanced Options", open=False):
173
- with gr.Row():
174
- negative = gr.Textbox(label="Negative prompt", value="low quality, ugly, blurry, poor face, bad anatomy")
175
- with gr.Row():
176
- width = gr.Slider(
177
- label="Width",
178
- minimum=512,
179
- maximum=1280,
180
- step=8,
181
- value=1024,
182
- )
183
- height = gr.Slider(
184
- label="Height",
185
- minimum=512,
186
- maximum=1280,
187
- step=8,
188
- value=1024,
189
- )
190
- with gr.Row():
191
- scales = gr.Slider(
192
- label="Guidance",
193
- minimum=3.5,
194
- maximum=7,
195
- step=0.1,
196
- value=5,
197
- )
198
- steps = gr.Slider(
199
- label="Steps",
200
- minimum=1,
201
- maximum=50,
202
- step=1,
203
- value=30,
204
- )
205
- strength = gr.Slider(
206
- label="Strength",
207
- minimum=0.0,
208
- maximum=1.0,
209
- step=0.1,
210
- value=0.7,
211
- )
212
- with gr.Row():
213
- seed = gr.Slider(
214
- label="Seed (-1 Get Random)",
215
- minimum=-1,
216
- maximum=MAX_SEED,
217
- step=1,
218
- value=-1,
219
- scale=2,
220
- )
221
- nums = gr.Slider(
222
- label="Image Numbers",
223
- minimum=1,
224
- maximum=4,
225
- step=1,
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,