sand74 commited on
Commit
a510382
·
verified ·
1 Parent(s): 2095f14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -1
app.py CHANGED
@@ -133,6 +133,8 @@ with gr.Blocks(css=css) as demo:
133
  label="LoRA Strength (Scale)"
134
  )
135
 
 
 
136
  with gr.Blocks():
137
  title = gr.Markdown(" ## ControlNet section")
138
  with gr.Column():
@@ -163,7 +165,35 @@ with gr.Blocks(css=css) as demo:
163
  outputs=controlnet_section
164
  )
165
 
166
- result = gr.Image(label="Result", show_label=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
 
168
  with gr.Accordion("Advanced Settings", open=False):
169
  negative_prompt = gr.Text(
 
133
  label="LoRA Strength (Scale)"
134
  )
135
 
136
+ result = gr.Image(label="Result", show_label=False)
137
+
138
  with gr.Blocks():
139
  title = gr.Markdown(" ## ControlNet section")
140
  with gr.Column():
 
165
  outputs=controlnet_section
166
  )
167
 
168
+ with gr.Blocks():
169
+ title = gr.Markdown(" ## IP-adapter section")
170
+ with gr.Column():
171
+ use_ip_adapter = gr.Checkbox(label="Use IP-adapter", value=False)
172
+
173
+ # Секция IP-adapter (изначально скрыта)
174
+ with gr.Column(visible=False) as ip_adapter_section:
175
+ controlnet_strength = gr.Slider(
176
+ minimum=0.1, maximum=2.0, value=1.0,
177
+ label="ControlNet Strength",
178
+ interactive=True
179
+ )
180
+ controlnet_mode = gr.Dropdown(
181
+ ["edge_detection", "pose_estimation", "depth_map", "scribble"],
182
+ value="edge_detection",
183
+ label="ControlNet mode",
184
+ interactive=True
185
+ )
186
+ controlnet_image = gr.Image(
187
+ label="ControlNet image",
188
+ type="pil"
189
+ )
190
+
191
+ # Показывать/скрывать секцию ControlNet в зависимости от чекбокса
192
+ use_ip_adapter.change(
193
+ fn=lambda x: gr.update(visible=x),
194
+ inputs=use_ip_adapter,
195
+ outputs=ip_adapter_section
196
+ )
197
 
198
  with gr.Accordion("Advanced Settings", open=False):
199
  negative_prompt = gr.Text(