Commit e162b6f7 authored by Qirui Sun's avatar Qirui Sun
Browse files

controlnet update

1 merge request!1now merge Ip branch to master
Showing with 4 additions and 4 deletions
+4 -4
......@@ -800,13 +800,13 @@ class Script(scripts.Script, metaclass=(
print(f'**test: {unit.multi_references_dir}')
assert os.path.splitext(unit.multi_references_dir)[1] == '.pt'
image_dir = os.path.dirname(unit.multi_references_dir)
input_images = [Image.open(os.path.join(image_dir, name)).convert("RGB") for name in os.listdir(image_dir) \
if os.path.splitext(name)[1] in ['.jpg', '.png']]
input_images = [Image.open(os.path.join(image_dir, name)).convert("RGB") for name in os.listdir(image_dir) if os.path.splitext(name)[1] in ['.jpg', '.png']]
unit.multi_references_dir = None if unit.multi_references_dir == '' else unit.multi_references_dir
except FileNotFoundError as e:
print(f'Error is happened:{e}')
elif unit.image is not None:
input_images = [input_image]
input_images = [input_image] # [cv2.resize(input_image, (224, 224))] if control_model_type == ControlModelType.IPAdapter else [input_image]
else:
print("Enter at least one for 'input image' and 'input image dir'")
......@@ -1212,4 +1212,4 @@ def on_ui_settings():
batch_hijack.instance.do_hijack()
script_callbacks.on_ui_settings(on_ui_settings)
script_callbacks.on_infotext_pasted(Infotext.on_infotext_pasted)
script_callbacks.on_after_component(ControlNetUiGroup.on_after_component)
script_callbacks.on_after_component(ControlNetUiGroup.on_after_component)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment