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
d26d8937
Commit
d26d8937
authored
Sep 23, 2022
by
Robin Fernandes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary duplication
parent
03738668
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
modules/processing.py
modules/processing.py
+4
-1
No files found.
modules/processing.py
View file @
d26d8937
...
...
@@ -20,6 +20,7 @@ import modules.shared as shared
import
modules.face_restoration
import
modules.images
as
images
import
modules.styles
import
logging
# some of those options should not be changed at all because they would break the model, so I removed them from options.
...
...
@@ -28,11 +29,13 @@ opt_f = 8
def
setup_color_correction
(
image
):
logging
.
info
(
"Calibrating color correction."
)
correction_target
=
cv2
.
cvtColor
(
np
.
asarray
(
image
.
copy
()),
cv2
.
COLOR_RGB2LAB
)
return
correction_target
def
apply_color_correction
(
correction
,
image
):
logging
.
info
(
"Applying color correction."
)
image
=
Image
.
fromarray
(
cv2
.
cvtColor
(
exposure
.
match_histograms
(
cv2
.
cvtColor
(
np
.
asarray
(
image
),
...
...
@@ -367,7 +370,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
if
p
.
color_corrections
is
not
None
and
i
<
len
(
p
.
color_corrections
):
if
opts
.
save
and
not
p
.
do_not_save_samples
and
opts
.
save_images_before_color_correction
:
images
.
save_image
(
Image
.
fromarray
(
x_sample
)
,
p
.
outpath_samples
,
""
,
seeds
[
i
],
prompts
[
i
],
opts
.
samples_format
,
info
=
infotext
(
n
,
i
),
p
=
p
,
suffix
=
"-before-color-correction"
)
images
.
save_image
(
image
,
p
.
outpath_samples
,
""
,
seeds
[
i
],
prompts
[
i
],
opts
.
samples_format
,
info
=
infotext
(
n
,
i
),
p
=
p
,
suffix
=
"-before-color-correction"
)
image
=
apply_color_correction
(
p
.
color_corrections
[
i
],
image
)
if
p
.
overlay_images
is
not
None
and
i
<
len
(
p
.
overlay_images
):
...
...
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