prithivMLmods commited on
Commit
68a577b
·
verified ·
1 Parent(s): b4b9b78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +61 -58
app.py CHANGED
@@ -4,8 +4,6 @@ import random
4
  import uuid
5
  import gradio as gr
6
  import numpy as np
7
- from PIL import Image
8
- import spaces
9
  import torch
10
  from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
11
 
@@ -151,22 +149,25 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
151
  gr.Markdown(DESCRIPTIONx)
152
 
153
  with gr.Row():
154
- prompt = gr.Text(
155
- label="Prompt",
156
- show_label=False,
157
- max_lines=1,
158
- placeholder="Enter your prompt",
159
- container=False,
160
- )
161
- run_button = gr.Button("Run🚀", scale=0)
162
- result = gr.Gallery(label="Result", columns=1, show_label=False)
 
 
 
 
 
 
 
 
163
 
164
- with gr.Row():
165
- model_choice = gr.Dropdown(
166
- label="Model",
167
- choices=list(MODEL_OPTIONS.keys()),
168
- value="RealVisXL_V4.0_Lightning"
169
- )
170
 
171
  with gr.Accordion("Advanced options", open=True):
172
  num_images = gr.Slider(
@@ -176,17 +177,16 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
176
  step=1,
177
  value=1,
178
  )
179
- with gr.Row():
180
- with gr.Column(scale=1):
181
- use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
182
- negative_prompt = gr.Text(
183
- label="Negative prompt",
184
- max_lines=5,
185
- lines=4,
186
- placeholder="Enter a negative prompt",
187
- 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",
188
- visible=True,
189
- )
190
  seed = gr.Slider(
191
  label="Seed",
192
  minimum=0,
@@ -194,37 +194,40 @@ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
194
  step=1,
195
  value=0,
196
  )
 
197
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
198
- with gr.Row(visible=True):
199
- width = gr.Slider(
200
- label="Width",
201
- minimum=512,
202
- maximum=MAX_IMAGE_SIZE,
203
- step=64,
204
- value=1024,
205
- )
206
- height = gr.Slider(
207
- label="Height",
208
- minimum=512,
209
- maximum=MAX_IMAGE_SIZE,
210
- step=64,
211
- value=1024,
212
- )
213
- with gr.Row():
214
- guidance_scale = gr.Slider(
215
- label="Guidance Scale",
216
- minimum=0.1,
217
- maximum=6,
218
- step=0.1,
219
- value=3.0,
220
- )
221
- num_inference_steps = gr.Slider(
222
- label="Number of inference steps",
223
- minimum=1,
224
- maximum=25,
225
- step=1,
226
- value=20,
227
- )
 
 
228
 
229
  gr.Examples(
230
  examples=examples,
 
4
  import uuid
5
  import gradio as gr
6
  import numpy as np
 
 
7
  import torch
8
  from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
9
 
 
149
  gr.Markdown(DESCRIPTIONx)
150
 
151
  with gr.Row():
152
+ with gr.Column(scale=2):
153
+ prompt = gr.Text(
154
+ label="Prompt",
155
+ show_label=False,
156
+ max_lines=1,
157
+ placeholder="Enter your prompt",
158
+ container=False,
159
+ )
160
+ run_button = gr.Button("Run🚀", scale=0)
161
+
162
+ with gr.Column(scale=2):
163
+ model_choice = gr.Dropdown(
164
+ label="Model",
165
+ choices=list(MODEL_OPTIONS.keys()),
166
+ value="RealVisXL_V4.0_Lightning"
167
+ )
168
+ use_negative_prompt = gr.Checkbox(label="Use negative prompt", value=True)
169
 
170
+ result = gr.Gallery(label="Result", columns=1, show_label=False)
 
 
 
 
 
171
 
172
  with gr.Accordion("Advanced options", open=True):
173
  num_images = gr.Slider(
 
177
  step=1,
178
  value=1,
179
  )
180
+
181
+ negative_prompt = gr.Text(
182
+ label="Negative prompt",
183
+ max_lines=5,
184
+ lines=4,
185
+ placeholder="Enter a negative prompt",
186
+ 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",
187
+ visible=True,
188
+ )
189
+
 
190
  seed = gr.Slider(
191
  label="Seed",
192
  minimum=0,
 
194
  step=1,
195
  value=0,
196
  )
197
+
198
  randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
199
+
200
+ width = gr.Slider(
201
+ label="Width",
202
+ minimum=512,
203
+ maximum=MAX_IMAGE_SIZE,
204
+ step=64,
205
+ value=1024,
206
+ )
207
+
208
+ height = gr.Slider(
209
+ label="Height",
210
+ minimum=512,
211
+ maximum=MAX_IMAGE_SIZE,
212
+ step=64,
213
+ value=1024,
214
+ )
215
+
216
+ guidance_scale = gr.Slider(
217
+ label="Guidance Scale",
218
+ minimum=0.1,
219
+ maximum=6,
220
+ step=0.1,
221
+ value=3.0,
222
+ )
223
+
224
+ num_inference_steps = gr.Slider(
225
+ label="Number of inference steps",
226
+ minimum=1,
227
+ maximum=25,
228
+ step=1,
229
+ value=20,
230
+ )
231
 
232
  gr.Examples(
233
  examples=examples,