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
d18eb10e
Commit
d18eb10e
authored
Mar 13, 2024
by
Haoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add hook
parent
3e0146f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
modules/ui_postprocessing.py
modules/ui_postprocessing.py
+25
-0
No files found.
modules/ui_postprocessing.py
View file @
d18eb10e
...
...
@@ -4,6 +4,30 @@ import modules.infotext_utils as parameters_copypaste
from
modules.ui_components
import
ResizeHandleRow
def
hook_scale_update
(
inputs
):
resize
=
upscaler
=
None
for
script
in
inputs
:
if
script
.
label
==
"Resize"
:
resize
=
script
elif
script
.
label
==
"Upscaler 1"
:
upscaler
=
script
elif
resize
and
upscaler
:
break
def
update_scale
(
upscaler
:
str
,
slider
:
float
):
if
upscaler
[
1
]
in
(
'x'
,
'X'
):
try
:
scale
=
int
(
upscaler
[
0
])
return
gr
.
update
(
value
=
scale
)
except
ValueError
:
return
gr
.
update
(
value
=
slider
)
return
gr
.
update
(
value
=
slider
)
if
resize
and
upscaler
:
upscaler
.
input
(
update_scale
,
inputs
=
[
upscaler
,
resize
],
outputs
=
[
resize
])
def
create_ui
():
dummy_component
=
gr
.
Label
(
visible
=
False
)
tab_index
=
gr
.
Number
(
value
=
0
,
visible
=
False
)
...
...
@@ -23,6 +47,7 @@ def create_ui():
show_extras_results
=
gr
.
Checkbox
(
label
=
'Show result images'
,
value
=
True
,
elem_id
=
"extras_show_extras_results"
)
script_inputs
=
scripts
.
scripts_postproc
.
setup_ui
()
hook_scale_update
(
script_inputs
)
with
gr
.
Column
():
toprow
=
ui_toprow
.
Toprow
(
is_compact
=
True
,
is_img2img
=
False
,
id_part
=
"extras"
)
...
...
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