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
e40b2d94
Commit
e40b2d94
authored
Apr 29, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change gradio callback from change to release in a bunch of places now that it's fixed in gradio
parent
a95dc025
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
javascript/ui.js
javascript/ui.js
+11
-0
modules/ui.py
modules/ui.py
+10
-2
No files found.
javascript/ui.js
View file @
e40b2d94
...
@@ -366,3 +366,14 @@ function currentImg2imgSourceResolution(_, _, scaleBy){
...
@@ -366,3 +366,14 @@ function currentImg2imgSourceResolution(_, _, scaleBy){
var
img
=
gradioApp
().
querySelector
(
'
#mode_img2img > div[style="display: block;"] img
'
)
var
img
=
gradioApp
().
querySelector
(
'
#mode_img2img > div[style="display: block;"] img
'
)
return
img
?
[
img
.
naturalWidth
,
img
.
naturalHeight
,
scaleBy
]
:
[
0
,
0
,
scaleBy
]
return
img
?
[
img
.
naturalWidth
,
img
.
naturalHeight
,
scaleBy
]
:
[
0
,
0
,
scaleBy
]
}
}
function
updateImg2imgResizeToTextAfterChangingImage
(){
// At the time this is called from gradio, the image has no yet been replaced.
// There may be a better solution, but this is simple and straightforward so I'm going with it.
setTimeout
(
function
()
{
gradioApp
().
getElementById
(
'
img2img_update_resize_to
'
).
click
()
},
500
);
return
[]
}
modules/ui.py
View file @
e40b2d94
...
@@ -782,8 +782,9 @@ def create_ui():
...
@@ -782,8 +782,9 @@ def create_ui():
with
FormRow
():
with
FormRow
():
scale_by_html
=
FormHTML
(
resize_from_to_html
(
0
,
0
,
0.0
),
elem_id
=
"img2img_scale_resolution_preview"
)
scale_by_html
=
FormHTML
(
resize_from_to_html
(
0
,
0
,
0.0
),
elem_id
=
"img2img_scale_resolution_preview"
)
gr
.
Slider
(
label
=
"Unused"
,
elem_id
=
"img2img_unused_scale_by_slider"
)
gr
.
Slider
(
label
=
"Unused"
,
elem_id
=
"img2img_unused_scale_by_slider"
)
button_update_resize_to
=
gr
.
Button
(
visible
=
False
,
elem_id
=
"img2img_update_resize_to"
)
scale_by
.
change
(
on_change_args
=
dict
(
fn
=
resize_from_to_html
,
fn
=
resize_from_to_html
,
_js
=
"currentImg2imgSourceResolution"
,
_js
=
"currentImg2imgSourceResolution"
,
inputs
=
[
dummy_component
,
dummy_component
,
scale_by
],
inputs
=
[
dummy_component
,
dummy_component
,
scale_by
],
...
@@ -791,6 +792,12 @@ def create_ui():
...
@@ -791,6 +792,12 @@ def create_ui():
show_progress
=
False
,
show_progress
=
False
,
)
)
scale_by
.
release
(
**
on_change_args
)
button_update_resize_to
.
click
(
**
on_change_args
)
for
component
in
img2img_image_inputs
:
component
.
change
(
fn
=
lambda
:
None
,
_js
=
"updateImg2imgResizeToTextAfterChangingImage"
,
inputs
=
[],
outputs
=
[],
show_progress
=
False
)
tab_scale_to
.
select
(
fn
=
lambda
:
0
,
inputs
=
[],
outputs
=
[
selected_scale_tab
])
tab_scale_to
.
select
(
fn
=
lambda
:
0
,
inputs
=
[],
outputs
=
[
selected_scale_tab
])
tab_scale_by
.
select
(
fn
=
lambda
:
1
,
inputs
=
[],
outputs
=
[
selected_scale_tab
])
tab_scale_by
.
select
(
fn
=
lambda
:
1
,
inputs
=
[],
outputs
=
[
selected_scale_tab
])
...
@@ -1647,7 +1654,8 @@ def create_ui():
...
@@ -1647,7 +1654,8 @@ def create_ui():
component
=
component_dict
[
k
]
component
=
component_dict
[
k
]
info
=
opts
.
data_labels
[
k
]
info
=
opts
.
data_labels
[
k
]
component
.
change
(
change_handler
=
component
.
release
if
hasattr
(
component
,
'release'
)
else
component
.
change
change_handler
(
fn
=
lambda
value
,
k
=
k
:
run_settings_single
(
value
,
key
=
k
),
fn
=
lambda
value
,
k
=
k
:
run_settings_single
(
value
,
key
=
k
),
inputs
=
[
component
],
inputs
=
[
component
],
outputs
=
[
component
,
text_settings
],
outputs
=
[
component
,
text_settings
],
...
...
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