Skip to content

Commit 409c562

Browse files
authored
Merge pull request AUTOMATIC1111#124 from Lissanro/2048-annotator-resolution
Increase Annotator resolution to 2048
2 parents 623c5a4 + 7bb00e0 commit 409c562

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scripts/controlnet.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -189,56 +189,56 @@ def refresh_all_models(*inputs):
189189
def build_sliders(module):
190190
if module == "canny":
191191
return [
192-
gr.update(label="Annotator resolution", value=512, minimum=64, maximum=1024, step=1, interactive=True),
192+
gr.update(label="Annotator resolution", value=512, minimum=64, maximum=2048, step=1, interactive=True),
193193
gr.update(label="Canny low threshold", minimum=1, maximum=255, value=100, step=1, interactive=True),
194194
gr.update(label="Canny high threshold", minimum=1, maximum=255, value=200, step=1, interactive=True),
195195
]
196196
elif module == "mlsd": #Hough
197197
return [
198-
gr.update(label="Hough Resolution", minimum=128, maximum=1024, value=512, step=1, interactive=True),
198+
gr.update(label="Hough Resolution", minimum=64, maximum=2048, value=512, step=1, interactive=True),
199199
gr.update(label="Hough value threshold (MLSD)", minimum=0.01, maximum=2.0, value=0.1, step=0.01, interactive=True),
200200
gr.update(label="Hough distance threshold (MLSD)", minimum=0.01, maximum=20.0, value=0.1, step=0.01, interactive=True)
201201
]
202202
elif module in ["hed", "fake_scribble"]:
203203
return [
204-
gr.update(label="HED Resolution", minimum=128, maximum=1024, value=512, step=1, interactive=True),
204+
gr.update(label="HED Resolution", minimum=64, maximum=2048, value=512, step=1, interactive=True),
205205
gr.update(label="Threshold A", value=64, minimum=64, maximum=1024, interactive=False),
206206
gr.update(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False),
207207
]
208208
elif module in ["openpose", "openpose_hand", "segmentation"]:
209209
return [
210-
gr.update(label="Annotator Resolution", minimum=128, maximum=1024, value=512, step=1, interactive=True),
210+
gr.update(label="Annotator Resolution", minimum=64, maximum=2048, value=512, step=1, interactive=True),
211211
gr.update(label="Threshold A", value=64, minimum=64, maximum=1024, interactive=False),
212212
gr.update(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False),
213213
]
214214
elif module == "depth":
215215
return [
216-
gr.update(label="Midas Resolution", minimum=128, maximum=1024, value=384, step=1, interactive=True),
216+
gr.update(label="Midas Resolution", minimum=64, maximum=2048, value=384, step=1, interactive=True),
217217
gr.update(label="Threshold A", value=64, minimum=64, maximum=1024, interactive=False),
218218
gr.update(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False),
219219
]
220220
elif module == "normal_map":
221221
return [
222-
gr.update(label="Normal Resolution", minimum=128, maximum=1024, value=512, step=1, interactive=True),
222+
gr.update(label="Normal Resolution", minimum=64, maximum=2048, value=512, step=1, interactive=True),
223223
gr.update(label="Normal background threshold", minimum=0.0, maximum=1.0, value=0.4, step=0.01, interactive=True),
224224
gr.update(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False),
225225
]
226226
elif module == "none":
227227
return [
228-
gr.update(label="Normal Resolution", value=64, minimum=64, maximum=1024, interactive=False),
228+
gr.update(label="Normal Resolution", value=64, minimum=64, maximum=2048, interactive=False),
229229
gr.update(label="Threshold A", value=64, minimum=64, maximum=1024, interactive=False),
230230
gr.update(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False),
231231
]
232232
else:
233233
return [
234-
gr.update(label="Annotator resolution", value=512, minimum=64, maximum=1024, step=1, interactive=True),
234+
gr.update(label="Annotator resolution", value=512, minimum=64, maximum=2048, step=1, interactive=True),
235235
gr.update(label="Threshold A", value=64, minimum=64, maximum=1024, interactive=False),
236236
gr.update(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False),
237237
]
238238

239239
# advanced options
240240
with gr.Column():
241-
processor_res = gr.Slider(label="Annotator resolution", value=64, minimum=64, maximum=1024, interactive=False)
241+
processor_res = gr.Slider(label="Annotator resolution", value=64, minimum=64, maximum=2048, interactive=False)
242242
threshold_a = gr.Slider(label="Threshold A", value=64, minimum=64, maximum=1024, interactive=False)
243243
threshold_b = gr.Slider(label="Threshold B", value=64, minimum=64, maximum=1024, interactive=False)
244244

0 commit comments

Comments
 (0)