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

fix the controlnet bugs on the image2image no control image input

No related merge requests found
Showing with 4 additions and 4 deletions
+4 -4
......@@ -701,7 +701,7 @@ class Script(scripts.Script, metaclass=(
# JIAHUI'S MODIFY
_module = unit.module
input_image, image_from_a1111 = Script.choose_input_image(p, unit, idx) if unit.image is not None else (None, True)
input_image, image_from_a1111 = Script.choose_input_image(p, unit, idx)
if isinstance(model_net, PlugableIPAdapter) and unit.ip_mask_enable:
unit.module = _module
......@@ -806,9 +806,9 @@ class Script(scripts.Script, metaclass=(
# JIAHUI'S MODIFY
preprocessor_resolution = None
# reference mode priority is 'single' > 'Multiple'
if unit.image is None and unit.multi_references_dir != '':
if unit.image is None and unit.multi_references_dir != '' and unit.multi_references_dir != None :
try:
print(f'**test: {unit.multi_references_dir}')
logger.info(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']]
......@@ -819,7 +819,7 @@ class Script(scripts.Script, metaclass=(
elif unit.image is not None:
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'")
logger.info("Using the default image input as A1111")
if unit.pixel_perfect:
preprocessor_resolution_list = []
......
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