prithivMLmods commited on
Commit
184327b
1 Parent(s): 10cb780

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +60 -62
app.py CHANGED
@@ -9,9 +9,12 @@ import spaces
9
  import torch
10
  from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
11
 
12
-
13
  DESCRIPTIONx = """
 
 
14
  ## TEXT 2 IMAGE PLAYGROUND 🥠
 
 
15
  """
16
 
17
  css = '''
@@ -152,26 +155,23 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
152
  gr.Markdown(DESCRIPTIONx)
153
 
154
  with gr.Row():
155
- with gr.Column(scale=2):
156
- prompt = gr.Text(
157
- label="Prompt",
158
- show_label=False,
159
- max_lines=1,
160
- placeholder="Enter your prompt",
161
- container=False,
162
- )
163
- run_button = gr.Button("Run🚀", scale=0)
164
-
165
- with gr.Column(scale=2):
166
- model_choice = gr.Dropdown(
167
- label="Model",
168
- choices=list(MODEL_OPTIONS.keys()),
169
- value="RealVisXL_V4.0_Lightning"
170
- )
171
- use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
172
-
173
  result = gr.Gallery(label="Result", columns=1, show_label=False)
174
 
 
 
 
 
 
 
 
175
  with gr.Accordion("Advanced options", open=True):
176
  num_images = gr.Slider(
177
  label="Number of Images",
@@ -180,16 +180,17 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
180
  step=1,
181
  value=1,
182
  )
183
-
184
- negative_prompt = gr.Text(
185
- label="Negative prompt",
186
- max_lines=5,
187
- lines=4,
188
- placeholder="Enter a negative prompt",
189
- value="(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation",
190
- visible=True,
191
- )
192
-
 
193
  seed = gr.Slider(
194
  label="Seed",
195
  minimum=0,
@@ -197,40 +198,37 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
197
  step=1,
198
  value=0,
199
  )
200
-
201
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
202
-
203
- width = gr.Slider(
204
- label="Width",
205
- minimum=512,
206
- maximum=MAX_IMAGE_SIZE,
207
- step=64,
208
- value=1024,
209
- )
210
-
211
- height = gr.Slider(
212
- label="Height",
213
- minimum=512,
214
- maximum=MAX_IMAGE_SIZE,
215
- step=64,
216
- value=1024,
217
- )
218
-
219
- guidance_scale = gr.Slider(
220
- label="Guidance Scale",
221
- minimum=0.1,
222
- maximum=6,
223
- step=0.1,
224
- value=3.0,
225
- )
226
-
227
- num_inference_steps = gr.Slider(
228
- label="Number of inference steps",
229
- minimum=1,
230
- maximum=25,
231
- step=1,
232
- value=20,
233
- )
234
 
235
  gr.Examples(
236
  examples=examples,
 
9
  import torch
10
  from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
11
 
 
12
  DESCRIPTIONx = """
13
+
14
+
15
  ## TEXT 2 IMAGE PLAYGROUND 🥠
16
+
17
+
18
  """
19
 
20
  css = '''
 
155
  gr.Markdown(DESCRIPTIONx)
156
 
157
  with gr.Row():
158
+ prompt = gr.Text(
159
+ label="Prompt",
160
+ show_label=False,
161
+ max_lines=1,
162
+ placeholder="Enter your prompt",
163
+ container=False,
164
+ )
165
+ run_button = gr.Button("Run🚀", scale=0)
 
 
 
 
 
 
 
 
 
 
166
  result = gr.Gallery(label="Result", columns=1, show_label=False)
167
 
168
+ with gr.Row():
169
+ model_choice = gr.Dropdown(
170
+ label="Model",
171
+ choices=list(MODEL_OPTIONS.keys()),
172
+ value="RealVisXL_V4.0_Lightning"
173
+ )
174
+
175
  with gr.Accordion("Advanced options", open=True):
176
  num_images = gr.Slider(
177
  label="Number of Images",
 
180
  step=1,
181
  value=1,
182
  )
183
+ with gr.Row():
184
+ with gr.Column(scale=1):
185
+ use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
186
+ negative_prompt = gr.Text(
187
+ label="Negative prompt",
188
+ max_lines=5,
189
+ lines=4,
190
+ placeholder="Enter a negative prompt",
191
+ value="(deformed, distorted, disfigured:1.3), poorly drawn, bad anatomy, wrong anatomy, extra limb, missing limb, floating limbs, (mutated hands and fingers:1.4), disconnected limbs, mutation, mutated, ugly, disgusting, blurry, amputation",
192
+ visible=True,
193
+ )
194
  seed = gr.Slider(
195
  label="Seed",
196
  minimum=0,
 
198
  step=1,
199
  value=0,
200
  )
 
201
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
202
+ with gr.Row(visible=True):
203
+ width = gr.Slider(
204
+ label="Width",
205
+ minimum=512,
206
+ maximum=MAX_IMAGE_SIZE,
207
+ step=64,
208
+ value=1024,
209
+ )
210
+ height = gr.Slider(
211
+ label="Height",
212
+ minimum=512,
213
+ maximum=MAX_IMAGE_SIZE,
214
+ step=64,
215
+ value=1024,
216
+ )
217
+ with gr.Row():
218
+ guidance_scale = gr.Slider(
219
+ label="Guidance Scale",
220
+ minimum=0.1,
221
+ maximum=6,
222
+ step=0.1,
223
+ value=3.0,
224
+ )
225
+ num_inference_steps = gr.Slider(
226
+ label="Number of inference steps",
227
+ minimum=1,
228
+ maximum=25,
229
+ step=1,
230
+ value=20,
231
+ )
 
 
232
 
233
  gr.Examples(
234
  examples=examples,