Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
df476d9f
Unverified
Commit
df476d9f
authored
Dec 20, 2023
by
raven
Committed by
GitHub
Dec 19, 2023
Browse files
[Docs] Fix a code example in the ControlNet Inpainting documentation (#6236)
fix document on masked image in inpainting controlnet
parent
3e71a206
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
docs/source/en/using-diffusers/controlnet.md
docs/source/en/using-diffusers/controlnet.md
+1
-1
No files found.
docs/source/en/using-diffusers/controlnet.md
View file @
df476d9f
...
...
@@ -203,7 +203,7 @@ def make_inpaint_condition(image, image_mask):
image_mask
=
np
.
array
(
image_mask
.
convert
(
"L"
)).
astype
(
np
.
float32
)
/
255.0
assert
image
.
shape
[
0
:
1
]
==
image_mask
.
shape
[
0
:
1
]
image
[
image_mask
>
0.5
]
=
1.0
# set as masked pixel
image
[
image_mask
>
0.5
]
=
-
1.0
# set as masked pixel
image
=
np
.
expand_dims
(
image
,
0
).
transpose
(
0
,
3
,
1
,
2
)
image
=
torch
.
from_numpy
(
image
)
return
image
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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