Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
b5d705e2
Commit
b5d705e2
authored
Sep 24, 2022
by
EyeDeck
Committed by
AUTOMATIC1111
Sep 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable 'batch img2img' when launched with --hide-ui-dir-config
Prevent writing to arbitrary directories, as usual
parent
a2bea2f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
modules/img2img.py
modules/img2img.py
+2
-0
modules/shared.py
modules/shared.py
+1
-1
modules/ui.py
modules/ui.py
+4
-3
No files found.
modules/img2img.py
View file @
b5d705e2
...
...
@@ -108,6 +108,8 @@ def img2img(mode: int, prompt: str, negative_prompt: str, prompt_style: str, pro
p
.
extra_generation_params
[
"Mask blur"
]
=
mask_blur
if
is_batch
:
assert
not
shared
.
cmd_opts
.
hide_ui_dir_config
,
"Launched with --hide-ui-dir-config, batch img2img disabled"
process_batch
(
p
,
img2img_batch_input_dir
,
img2img_batch_output_dir
,
args
)
processed
=
Processed
(
p
,
[],
p
.
seed
,
""
)
...
...
modules/shared.py
View file @
b5d705e2
...
...
@@ -116,7 +116,7 @@ def options_section(section_identifer, options_dict):
return
options_dict
hide_dirs
=
{
"visible"
:
False
}
if
cmd_opts
.
hide_ui_dir_config
else
None
hide_dirs
=
{
"visible"
:
not
cmd_opts
.
hide_ui_dir_config
}
options_templates
=
{}
...
...
modules/ui.py
View file @
b5d705e2
...
...
@@ -578,9 +578,10 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
inpaint_full_res_padding
=
gr
.
Slider
(
label
=
'Inpaint at full resolution padding, pixels'
,
minimum
=
0
,
maximum
=
256
,
step
=
4
,
value
=
32
)
with
gr
.
TabItem
(
'Batch img2img'
,
id
=
'batch'
):
gr
.
HTML
(
"<p class=
\"
text-gray-500
\"
>Process images in a directory on the same machine where the server is running.</p>"
)
img2img_batch_input_dir
=
gr
.
Textbox
(
label
=
"Input directory"
)
img2img_batch_output_dir
=
gr
.
Textbox
(
label
=
"Output directory"
)
hidden
=
'<br>Disabled when launched with --hide-ui-dir-config.'
if
shared
.
cmd_opts
.
hide_ui_dir_config
else
''
gr
.
HTML
(
f
"<p class=
\"
text-gray-500
\"
>Process images in a directory on the same machine where the server is running.{hidden}</p>"
)
img2img_batch_input_dir
=
gr
.
Textbox
(
label
=
"Input directory"
,
**
shared
.
hide_dirs
)
img2img_batch_output_dir
=
gr
.
Textbox
(
label
=
"Output directory"
,
**
shared
.
hide_dirs
)
with
gr
.
Row
():
resize_mode
=
gr
.
Radio
(
label
=
"Resize mode"
,
elem_id
=
"resize_mode"
,
show_label
=
False
,
choices
=
[
"Just resize"
,
"Crop and resize"
,
"Resize and fill"
],
type
=
"index"
,
value
=
"Just resize"
)
...
...
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