Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
605d2768
Commit
605d2768
authored
Oct 25, 2022
by
random_thoughtss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added conditioning image masking to xy_grid.
Use `True` and `False` to select values.
parent
f9549d1c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
processing.py
modules/processing.py
+1
-1
xy_grid.py
scripts/xy_grid.py
+3
-0
No files found.
modules/processing.py
View file @
605d2768
...
@@ -770,7 +770,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
...
@@ -770,7 +770,7 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
conditioning_mask
=
conditioning_mask
.
to
(
image
.
device
)
conditioning_mask
=
conditioning_mask
.
to
(
image
.
device
)
conditioning_image
=
image
conditioning_image
=
image
if
shared
.
opts
.
inpainting_mask_image
:
if
getattr
(
self
,
"inpainting_mask_image"
,
shared
.
opts
.
inpainting_mask_image
)
:
conditioning_image
=
conditioning_image
*
(
1.0
-
conditioning_mask
)
conditioning_image
=
conditioning_image
*
(
1.0
-
conditioning_mask
)
conditioning_image
=
self
.
sd_model
.
get_first_stage_encoding
(
self
.
sd_model
.
encode_first_stage
(
conditioning_image
))
conditioning_image
=
self
.
sd_model
.
get_first_stage_encoding
(
self
.
sd_model
.
encode_first_stage
(
conditioning_image
))
...
...
scripts/xy_grid.py
View file @
605d2768
...
@@ -153,6 +153,8 @@ def str_permutations(x):
...
@@ -153,6 +153,8 @@ def str_permutations(x):
"""dummy function for specifying it in AxisOption's type when you want to get a list of permutations"""
"""dummy function for specifying it in AxisOption's type when you want to get a list of permutations"""
return
x
return
x
def
str_to_bool
(
x
):
return
"true"
in
x
.
lower
()
.
strip
()
AxisOption
=
namedtuple
(
"AxisOption"
,
[
"label"
,
"type"
,
"apply"
,
"format_value"
,
"confirm"
])
AxisOption
=
namedtuple
(
"AxisOption"
,
[
"label"
,
"type"
,
"apply"
,
"format_value"
,
"confirm"
])
AxisOptionImg2Img
=
namedtuple
(
"AxisOptionImg2Img"
,
[
"label"
,
"type"
,
"apply"
,
"format_value"
,
"confirm"
])
AxisOptionImg2Img
=
namedtuple
(
"AxisOptionImg2Img"
,
[
"label"
,
"type"
,
"apply"
,
"format_value"
,
"confirm"
])
...
@@ -178,6 +180,7 @@ axis_options = [
...
@@ -178,6 +180,7 @@ axis_options = [
AxisOption
(
"Eta"
,
float
,
apply_field
(
"eta"
),
format_value_add_label
,
None
),
AxisOption
(
"Eta"
,
float
,
apply_field
(
"eta"
),
format_value_add_label
,
None
),
AxisOption
(
"Clip skip"
,
int
,
apply_clip_skip
,
format_value_add_label
,
None
),
AxisOption
(
"Clip skip"
,
int
,
apply_clip_skip
,
format_value_add_label
,
None
),
AxisOption
(
"Denoising"
,
float
,
apply_field
(
"denoising_strength"
),
format_value_add_label
,
None
),
AxisOption
(
"Denoising"
,
float
,
apply_field
(
"denoising_strength"
),
format_value_add_label
,
None
),
AxisOption
(
"Mask Conditioning Image"
,
str_to_bool
,
apply_field
(
"inpainting_mask_image"
),
format_value_add_label
,
None
),
]
]
...
...
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