prithivMLmods commited on
Commit
93429f0
1 Parent(s): 5777740

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +63 -65
app.py CHANGED
@@ -13,10 +13,8 @@ DESCRIPTIONx = """
13
 
14
  ## TEXT 2 IMAGE PLAYGROUND 🥠
15
 
16
-
17
  """
18
 
19
-
20
  css = '''
21
  .gradio-container{max-width: 1000px !important}
22
  h1{text-align:center}
@@ -126,17 +124,18 @@ def generate(
126
 
127
  with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
128
  gr.Markdown(DESCRIPTIONx)
 
129
  with gr.Row():
130
  with gr.Column(scale=1):
131
- prompt = gr.Text(
132
- label="Prompt",
133
- show_label=False,
134
- max_lines=1,
135
- placeholder="Enter your prompt",
136
- container=False,
137
- )
138
- run_button = gr.Button("Run🚀", scale=0)
139
- result = gr.Gallery(label="Result", columns=1, show_label=False)
140
 
141
  with gr.Row():
142
  model_choice = gr.Dropdown(
@@ -146,62 +145,62 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
146
  )
147
 
148
  with gr.Accordion("Advanced options", open=True):
149
- with gr.Column(scale=3):
150
- num_images = gr.Slider(
151
- label="Number of Images",
152
- minimum=1,
153
- maximum=4,
154
- step=1,
155
- value=1,
156
- )
157
- with gr.Row():
158
- use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
159
- negative_prompt = gr.Text(
160
- label="Negative prompt",
161
- max_lines=5,
162
- lines=4,
163
- placeholder="Enter a negative prompt",
164
- 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",
165
- visible=True,
166
- )
167
- seed = gr.Slider(
168
- label="Seed",
169
- minimum=0,
170
- maximum=MAX_SEED,
171
- step=1,
172
- value=0,
173
- )
174
- randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
175
- with gr.Row(visible=True):
176
- width = gr.Slider(
177
- label="Width",
178
- minimum=512,
179
- maximum=MAX_IMAGE_SIZE,
180
- step=64,
181
- value=1024,
182
- )
183
- height = gr.Slider(
184
- label="Height",
185
- minimum=512,
186
- maximum=MAX_IMAGE_SIZE,
187
- step=64,
188
- value=1024,
189
- )
190
- with gr.Row():
191
- guidance_scale = gr.Slider(
192
- label="Guidance Scale",
193
- minimum=0.1,
194
- maximum=6,
195
- step=0.1,
196
- value=3.0,
197
- )
198
- num_inference_steps = gr.Slider(
199
- label="Number of inference steps",
200
  minimum=1,
201
- maximum=25,
202
  step=1,
203
- value=23,
204
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
205
 
206
  gr.Examples(
207
  examples=examples,
@@ -240,6 +239,5 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
240
  api_name="run",
241
  )
242
 
243
-
244
  if __name__ == "__main__":
245
  demo.queue(max_size=40).launch(show_api=False)
 
13
 
14
  ## TEXT 2 IMAGE PLAYGROUND 🥠
15
 
 
16
  """
17
 
 
18
  css = '''
19
  .gradio-container{max-width: 1000px !important}
20
  h1{text-align:center}
 
124
 
125
  with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
126
  gr.Markdown(DESCRIPTIONx)
127
+
128
  with gr.Row():
129
  with gr.Column(scale=1):
130
+ prompt = gr.Text(
131
+ label="Prompt",
132
+ show_label=False,
133
+ max_lines=1,
134
+ placeholder="Enter your prompt",
135
+ container=False,
136
+ )
137
+ run_button = gr.Button("Run🚀", scale=0)
138
+ result = gr.Gallery(label="Result", columns=1, show_label=False)
139
 
140
  with gr.Row():
141
  model_choice = gr.Dropdown(
 
145
  )
146
 
147
  with gr.Accordion("Advanced options", open=True):
148
+ with gr.Column(scale=3):
149
+ num_images = gr.Slider(
150
+ label="Number of Images",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  minimum=1,
152
+ maximum=4,
153
  step=1,
154
+ value=1,
155
  )
156
+ with gr.Row():
157
+ use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
158
+ negative_prompt = gr.Text(
159
+ label="Negative prompt",
160
+ max_lines=5,
161
+ lines=4,
162
+ placeholder="Enter a negative prompt",
163
+ 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",
164
+ visible=True,
165
+ )
166
+ seed = gr.Slider(
167
+ label="Seed",
168
+ minimum=0,
169
+ maximum=MAX_SEED,
170
+ step=1,
171
+ value=0,
172
+ )
173
+ randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
174
+ with gr.Row(visible=True):
175
+ width = gr.Slider(
176
+ label="Width",
177
+ minimum=512,
178
+ maximum=MAX_IMAGE_SIZE,
179
+ step=64,
180
+ value=1024,
181
+ )
182
+ height = gr.Slider(
183
+ label="Height",
184
+ minimum=512,
185
+ maximum=MAX_IMAGE_SIZE,
186
+ step=64,
187
+ value=1024,
188
+ )
189
+ with gr.Row():
190
+ guidance_scale = gr.Slider(
191
+ label="Guidance Scale",
192
+ minimum=0.1,
193
+ maximum=6,
194
+ step=0.1,
195
+ value=3.0,
196
+ )
197
+ num_inference_steps = gr.Slider(
198
+ label="Number of inference steps",
199
+ minimum=1,
200
+ maximum=25,
201
+ step=1,
202
+ value=23,
203
+ )
204
 
205
  gr.Examples(
206
  examples=examples,
 
239
  api_name="run",
240
  )
241
 
 
242
  if __name__ == "__main__":
243
  demo.queue(max_size=40).launch(show_api=False)