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
c81b52ff
Commit
c81b52ff
authored
Jan 29, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add override settings component to img2img
parent
847ceae1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
img2img.py
modules/img2img.py
+5
-1
ui.py
modules/ui.py
+3
-2
No files found.
modules/img2img.py
View file @
c81b52ff
...
...
@@ -7,6 +7,7 @@ import numpy as np
from
PIL
import
Image
,
ImageOps
,
ImageFilter
,
ImageEnhance
,
ImageChops
from
modules
import
devices
,
sd_samplers
from
modules.generation_parameters_copypaste
import
create_override_settings_dict
from
modules.processing
import
Processed
,
StableDiffusionProcessingImg2Img
,
process_images
from
modules.shared
import
opts
,
state
import
modules.shared
as
shared
...
...
@@ -75,7 +76,9 @@ def process_batch(p, input_dir, output_dir, inpaint_mask_dir, args):
processed_image
.
save
(
os
.
path
.
join
(
output_dir
,
filename
))
def
img2img
(
id_task
:
str
,
mode
:
int
,
prompt
:
str
,
negative_prompt
:
str
,
prompt_styles
,
init_img
,
sketch
,
init_img_with_mask
,
inpaint_color_sketch
,
inpaint_color_sketch_orig
,
init_img_inpaint
,
init_mask_inpaint
,
steps
:
int
,
sampler_index
:
int
,
mask_blur
:
int
,
mask_alpha
:
float
,
inpainting_fill
:
int
,
restore_faces
:
bool
,
tiling
:
bool
,
n_iter
:
int
,
batch_size
:
int
,
cfg_scale
:
float
,
denoising_strength
:
float
,
seed
:
int
,
subseed
:
int
,
subseed_strength
:
float
,
seed_resize_from_h
:
int
,
seed_resize_from_w
:
int
,
seed_enable_extras
:
bool
,
height
:
int
,
width
:
int
,
resize_mode
:
int
,
inpaint_full_res
:
bool
,
inpaint_full_res_padding
:
int
,
inpainting_mask_invert
:
int
,
img2img_batch_input_dir
:
str
,
img2img_batch_output_dir
:
str
,
img2img_batch_inpaint_mask_dir
:
str
,
*
args
):
def
img2img
(
id_task
:
str
,
mode
:
int
,
prompt
:
str
,
negative_prompt
:
str
,
prompt_styles
,
init_img
,
sketch
,
init_img_with_mask
,
inpaint_color_sketch
,
inpaint_color_sketch_orig
,
init_img_inpaint
,
init_mask_inpaint
,
steps
:
int
,
sampler_index
:
int
,
mask_blur
:
int
,
mask_alpha
:
float
,
inpainting_fill
:
int
,
restore_faces
:
bool
,
tiling
:
bool
,
n_iter
:
int
,
batch_size
:
int
,
cfg_scale
:
float
,
denoising_strength
:
float
,
seed
:
int
,
subseed
:
int
,
subseed_strength
:
float
,
seed_resize_from_h
:
int
,
seed_resize_from_w
:
int
,
seed_enable_extras
:
bool
,
height
:
int
,
width
:
int
,
resize_mode
:
int
,
inpaint_full_res
:
bool
,
inpaint_full_res_padding
:
int
,
inpainting_mask_invert
:
int
,
img2img_batch_input_dir
:
str
,
img2img_batch_output_dir
:
str
,
img2img_batch_inpaint_mask_dir
:
str
,
override_settings_texts
,
*
args
):
override_settings
=
create_override_settings_dict
(
override_settings_texts
)
is_batch
=
mode
==
5
if
mode
==
0
:
# img2img
...
...
@@ -142,6 +145,7 @@ def img2img(id_task: str, mode: int, prompt: str, negative_prompt: str, prompt_s
inpaint_full_res
=
inpaint_full_res
,
inpaint_full_res_padding
=
inpaint_full_res_padding
,
inpainting_mask_invert
=
inpainting_mask_invert
,
override_settings
=
override_settings
,
)
p
.
scripts
=
modules
.
scripts
.
scripts_txt2img
...
...
modules/ui.py
View file @
c81b52ff
...
...
@@ -872,7 +872,8 @@ def create_ui():
inpainting_mask_invert
,
img2img_batch_input_dir
,
img2img_batch_output_dir
,
img2img_batch_inpaint_mask_dir
img2img_batch_inpaint_mask_dir
,
override_settings
,
]
+
custom_inputs
,
outputs
=
[
img2img_gallery
,
...
...
@@ -961,7 +962,7 @@ def create_ui():
parameters_copypaste
.
add_paste_fields
(
"img2img"
,
init_img
,
img2img_paste_fields
)
parameters_copypaste
.
add_paste_fields
(
"inpaint"
,
init_img_with_mask
,
img2img_paste_fields
)
parameters_copypaste
.
register_paste_params_button
(
parameters_copypaste
.
ParamBinding
(
paste_button
=
img2img_paste
,
tabname
=
"img2img"
,
source_text_component
=
img2img_prompt
,
source_image_component
=
None
,
paste_button
=
img2img_paste
,
tabname
=
"img2img"
,
source_text_component
=
img2img_prompt
,
source_image_component
=
None
,
override_settings_component
=
override_settings
,
))
modules
.
scripts
.
scripts_current
=
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