Alexander Bagus commited on
Commit
3f5ca3c
·
1 Parent(s): a218889
Files changed (2) hide show
  1. app.py +23 -20
  2. static/footer.html +10 -10
app.py CHANGED
@@ -187,11 +187,19 @@ with gr.Blocks(css=css) as demo:
187
  is_polish_prompt = gr.Checkbox(label="Polish prompt", value=True)
188
  control_mode = gr.Radio(
189
  choices=["Canny", "Depth", "HED", "MLSD", "Pose"],
190
- value="HED",
191
  label="Control Mode"
192
  )
193
  run_button = gr.Button("Generate", variant="primary")
194
  with gr.Accordion("Advanced Settings", open=False):
 
 
 
 
 
 
 
 
195
  seed = gr.Slider(
196
  label="Seed",
197
  minimum=0,
@@ -201,22 +209,16 @@ with gr.Blocks(css=css) as demo:
201
  )
202
 
203
  randomize_seed = gr.Checkbox(label="Randomize seed", value=False)
204
- negative_prompt = gr.Textbox(
205
- label="Negative prompt",
206
- lines=2,
207
- placeholder="Enter your prompt",
208
- value="blurry ugly bad"
209
- )
210
  with gr.Row():
211
- image_scale = gr.Slider(
212
- label="Image scale",
213
- minimum=0.5,
214
- maximum=2.0,
215
- step=0.1,
216
- value=1.0,
217
  )
218
  control_context_scale = gr.Slider(
219
- label="Control context scale",
220
  minimum=0.0,
221
  maximum=1.0,
222
  step=0.01,
@@ -232,13 +234,14 @@ with gr.Blocks(css=css) as demo:
232
  value=1.0,
233
  )
234
 
235
- num_inference_steps = gr.Slider(
236
- label="Number of inference steps",
237
- minimum=1,
238
- maximum=50,
239
- step=1,
240
- value=15,
241
  )
 
242
  with gr.Column():
243
  output_image = gr.Image(label="Generated image", show_label=False)
244
  polished_prompt = gr.Textbox(label="Polished prompt", interactive=False)
 
187
  is_polish_prompt = gr.Checkbox(label="Polish prompt", value=True)
188
  control_mode = gr.Radio(
189
  choices=["Canny", "Depth", "HED", "MLSD", "Pose"],
190
+ value="Canny",
191
  label="Control Mode"
192
  )
193
  run_button = gr.Button("Generate", variant="primary")
194
  with gr.Accordion("Advanced Settings", open=False):
195
+
196
+ negative_prompt = gr.Textbox(
197
+ label="Negative prompt",
198
+ lines=2,
199
+ placeholder="Enter your prompt",
200
+ value="blurry ugly bad"
201
+ )
202
+
203
  seed = gr.Slider(
204
  label="Seed",
205
  minimum=0,
 
209
  )
210
 
211
  randomize_seed = gr.Checkbox(label="Randomize seed", value=False)
 
 
 
 
 
 
212
  with gr.Row():
213
+ num_inference_steps = gr.Slider(
214
+ label="Steps",
215
+ minimum=1,
216
+ maximum=30,
217
+ step=1,
218
+ value=9,
219
  )
220
  control_context_scale = gr.Slider(
221
+ label="Context scale",
222
  minimum=0.0,
223
  maximum=1.0,
224
  step=0.01,
 
234
  value=1.0,
235
  )
236
 
237
+ image_scale = gr.Slider(
238
+ label="Image scale",
239
+ minimum=0.5,
240
+ maximum=2.0,
241
+ step=0.1,
242
+ value=1.0,
243
  )
244
+
245
  with gr.Column():
246
  output_image = gr.Image(label="Generated image", show_label=False)
247
  polished_prompt = gr.Textbox(label="Polished prompt", interactive=False)
static/footer.html CHANGED
@@ -1,16 +1,16 @@
1
  <div style="max-width: 640px;">
2
- I made this space after seeing a Reddit post about using ControlNet editing with Z-Image from Alibaba.
3
- The code looks solid and serves as a great example. I believe there’s a lot of potential to build on top of this, add new features, and explore even more creative ideas using this technique.
4
-
5
- <h2>Usage</h2>
6
- You can change control_context_scale for more control and better detail.
7
- For best results, use a detailed prompt.
8
- The recommended control_context_scale range is 0.65 to 0.80.
9
-
10
  <h2>Reference</h2>
11
  <ul>
12
- <li>Tongyi-MAI/Z-Image-Turbo: <a href="https://huggingface.co/Tongyi-MAI/Z-Image-Turbo">https://huggingface.co/Tongyi-MAI/Z-Image-Turbo</a></li>
13
- <li>alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union: <a href="https://huggingface.co/alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union">https://huggingface.co/alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union</a></li>
14
  <li>VideoX-Fun: <a href="https://github.com/aigc-apps/VideoX-Fun" rel="nofollow">https://github.com/aigc-apps/VideoX-Fun</a></li>
15
  <!-- https://github.com/comfyanonymous/ComfyUI/pull/11062 -->
16
  </ul>
 
1
  <div style="max-width: 640px;">
2
+ <h2>Usage</h2>
3
+ <ul>
4
+ <li>For best results, ZIT need a detailed prompt, which can be provided by enabling polish prompt.</li>
5
+ </ul>
6
+ <li>
7
+ You can change control_context_scale for more control and better detail.
8
+ The recommended control_context_scale range is 0.65 to 0.80.
9
+ </li>
10
  <h2>Reference</h2>
11
  <ul>
12
+ <li>alibaba-pai: <a href="https://huggingface.co/alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union">https://huggingface.co/alibaba-pai/Z-Image-Turbo-Fun-Controlnet-Union</a></li>
13
+ <li>Tongyi-MAI: <a href="https://huggingface.co/Tongyi-MAI/Z-Image-Turbo">https://huggingface.co/Tongyi-MAI/Z-Image-Turbo</a></li>
14
  <li>VideoX-Fun: <a href="https://github.com/aigc-apps/VideoX-Fun" rel="nofollow">https://github.com/aigc-apps/VideoX-Fun</a></li>
15
  <!-- https://github.com/comfyanonymous/ComfyUI/pull/11062 -->
16
  </ul>