Skip to content

Commit

Permalink
fix: annotator preview issue (Mikubill#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikubill committed Mar 5, 2023
1 parent eab5bc0 commit 63f7d3c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,12 @@ def run_annotator(image, module, pres, pthr_a, pthr_b):
preprocessor = self.preprocessor[module]
result = None
if pres > 64:
result = preprocessor(img, res=pres, thr_a=pthr_a, thr_b=pthr_b)
result, is_image = preprocessor(img, res=pres, thr_a=pthr_a, thr_b=pthr_b)
else:
result = preprocessor(img)
return gr.update(value=result, visible=True, interactive=False)
result, is_image = preprocessor(img)

if is_image:
return gr.update(value=result, visible=True, interactive=False)

with gr.Row():
annotator_button = gr.Button(value="Preview annotator result")
Expand Down

0 comments on commit 63f7d3c

Please sign in to comment.