Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jiahui Ming
sd-webui-controlnet
Commits
e8619473
Commit
e8619473
authored
1 year ago
by
Qirui Sun
Browse files
Options
Download
Email Patches
Plain Diff
fix the controlnet bugs on the image2image no control image input
parent
b5d3146e
ip-layer-wise
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/controlnet.py
+4
-4
scripts/controlnet.py
with
4 additions
and
4 deletions
+4
-4
scripts/controlnet.py
+
4
-
4
View file @
e8619473
...
...
@@ -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
=
[]
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets