ArrcttacsrjksX commited on
Commit
e7a333a
·
verified ·
1 Parent(s): f229815

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -28
app.py CHANGED
@@ -148,37 +148,32 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
148
  verbose = gr.Checkbox(label="Verbose Output", interactive=True)
149
  rng = gr.Radio(choices=["std_default", "cuda"], value="cuda", label="Random Number Generator", interactive=True)
150
 
151
- # Use gr.Box with scrollable=True
152
- with gr.Box(variant="panel", scrollable=True): # Replace Column with Box
153
  height = gr.Slider(
154
- 128, 1024, value=512, step=64, label="Image Height (px)", interactive=True
155
- )
156
  width = gr.Slider(
157
- 128, 1024, value=512, step=64, label="Image Width (px)", interactive=True
158
- )
159
  steps = gr.Slider(
160
- 1, 200, value=20, step=1, label="Steps", interactive=True
161
- )
162
  seed = gr.Slider(
163
- 0, 2147483647, value=-1, label="Seed", interactive=True
164
- )
165
-
166
- # Output section
167
- with gr.Row():
168
- output_image = gr.Image(label="Generated Image", type="pil")
169
- output_logs = gr.Textbox(label="Logs", interactive=True, lines=12)
170
-
171
- # Tạo nút Generate
172
- generate_btn = gr.Button("Generate Image")
173
- generate_btn.click(
174
- run_command,
175
- inputs=[
176
- prompt, mode, height, width, steps, seed, init_image, threads, weight_type, negative_prompt,
177
- cfg_scale, strength, style_ratio, control_strength, sampling_method, batch_count, schedule, clip_skip,
178
- vae_tiling, vae_on_cpu, clip_on_cpu, control_net_cpu, canny, color, verbose, rng
179
- ],
180
- outputs=[output_image, output_logs]
181
- )
182
 
183
- # Chạy giao diện
184
  demo.launch()
 
148
  verbose = gr.Checkbox(label="Verbose Output", interactive=True)
149
  rng = gr.Radio(choices=["std_default", "cuda"], value="cuda", label="Random Number Generator", interactive=True)
150
 
151
+ with gr.Column():
 
152
  height = gr.Slider(
153
+ 128, 1024, value=512, step=64, label="Image Height (px)", interactive=True
154
+ )
155
  width = gr.Slider(
156
+ 128, 1024, value=512, step=64, label="Image Width (px)", interactive=True
157
+ )
158
  steps = gr.Slider(
159
+ 1, 100, value=20, step=1, label="Sampling Steps", interactive=True
160
+ )
161
  seed = gr.Slider(
162
+ 1, 10000, value=42, step=1, label="Seed", interactive=True
163
+ )
164
+
165
+ generate_btn = gr.Button("Run")
166
+ output_image = gr.Image(label="Generated Image")
167
+ logs_output = gr.Textbox(label="Logs", interactive=False, lines=15)
168
+
169
+ generate_btn.click(
170
+ run_command,
171
+ inputs=[
172
+ prompt, mode, height, width, steps, seed, init_image, threads, weight_type, negative_prompt,
173
+ cfg_scale, strength, style_ratio, control_strength, sampling_method, batch_count, schedule,
174
+ clip_skip, vae_tiling, vae_on_cpu, clip_on_cpu, control_net_cpu, canny, color, verbose, rng
175
+ ],
176
+ outputs=[output_image, logs_output],
177
+ )
 
 
 
178
 
 
179
  demo.launch()