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
fe33be6c
Commit
fe33be6c
authored
Feb 05, 2023
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use Default if ValueError
parent
6d11cda4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
images.py
modules/images.py
+10
-2
No files found.
modules/images.py
View file @
fe33be6c
...
...
@@ -575,9 +575,17 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
image
.
already_saved_as
=
fullfn
target_side_length
=
int
(
opts
.
target_side_length
)
try
:
target_side_length
=
int
(
opts
.
target_side_length
)
except
ValueError
:
target_side_length
=
4000
try
:
img_downscale_threshold
=
float
(
opts
.
img_downscale_threshold
)
except
ValueError
:
img_downscale_threshold
=
4
oversize
=
image
.
width
>
target_side_length
or
image
.
height
>
target_side_length
if
opts
.
export_for_4chan
and
(
oversize
or
os
.
stat
(
fullfn
)
.
st_size
>
opts
.
img_downscale_threshold
*
1024
*
1024
):
if
opts
.
export_for_4chan
and
(
oversize
or
os
.
stat
(
fullfn
)
.
st_size
>
img_downscale_threshold
*
1024
*
1024
):
ratio
=
image
.
width
/
image
.
height
if
oversize
and
ratio
>
1
:
...
...
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