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
9aa4d098
Commit
9aa4d098
authored
Nov 09, 2023
by
Emily Zeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed changes that weren't merged properly
parent
a625a7bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
50 deletions
+1
-50
modules/ui.py
modules/ui.py
+1
-50
No files found.
modules/ui.py
View file @
9aa4d098
...
...
@@ -592,55 +592,6 @@ def create_ui():
if
category
==
"sampler"
:
steps
,
sampler_name
=
create_sampler_and_steps_selection
(
sd_samplers
.
visible_sampler_names
(),
"img2img"
)
elif
category
==
"dimensions"
:
with
FormRow
():
with
gr
.
Column
(
elem_id
=
"img2img_column_size"
,
scale
=
4
):
selected_scale_tab
=
gr
.
State
(
value
=
0
)
with
gr
.
Tabs
():
with
gr
.
Tab
(
label
=
"Resize to"
,
elem_id
=
"img2img_tab_resize_to"
)
as
tab_scale_to
:
with
FormRow
():
with
gr
.
Column
(
elem_id
=
"img2img_column_size"
,
scale
=
4
):
width
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
8
,
label
=
"Width"
,
value
=
512
,
elem_id
=
"img2img_width"
)
height
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
8
,
label
=
"Height"
,
value
=
512
,
elem_id
=
"img2img_height"
)
with
gr
.
Column
(
elem_id
=
"img2img_dimensions_row"
,
scale
=
1
,
elem_classes
=
"dimensions-tools"
):
res_switch_btn
=
ToolButton
(
value
=
switch_values_symbol
,
elem_id
=
"img2img_res_switch_btn"
,
tooltip
=
"Switch width/height"
)
detect_image_size_btn
=
ToolButton
(
value
=
detect_image_size_symbol
,
elem_id
=
"img2img_detect_image_size_btn"
,
tooltip
=
"Auto detect size from img2img"
)
with
gr
.
Tab
(
label
=
"Resize by"
,
elem_id
=
"img2img_tab_resize_by"
)
as
tab_scale_by
:
scale_by
=
gr
.
Slider
(
minimum
=
0.05
,
maximum
=
4.0
,
step
=
0.05
,
label
=
"Scale"
,
value
=
1.0
,
elem_id
=
"img2img_scale"
)
with
FormRow
():
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"
)
button_update_resize_to
=
gr
.
Button
(
visible
=
False
,
elem_id
=
"img2img_update_resize_to"
)
on_change_args
=
dict
(
fn
=
resize_from_to_html
,
_js
=
"currentImg2imgSourceResolution"
,
inputs
=
[
dummy_component
,
dummy_component
,
scale_by
],
outputs
=
scale_by_html
,
show_progress
=
False
,
)
scale_by
.
release
(
**
on_change_args
)
button_update_resize_to
.
click
(
**
on_change_args
)
# the code below is meant to update the resolution label after the image in the image selection UI has changed.
# as it is now the event keeps firing continuously for inpaint edits, which ruins the page with constant requests.
# I assume this must be a gradio bug and for now we'll just do it for non-inpaint inputs.
for
component
in
[
init_img
,
sketch
]:
component
.
change
(
fn
=
lambda
:
None
,
_js
=
"updateImg2imgResizeToTextAfterChangingImage"
,
inputs
=
[],
outputs
=
[],
show_progress
=
False
)
with
FormRow
():
resize_mode
=
gr
.
Radio
(
label
=
"Resize mode"
,
elem_id
=
"resize_mode"
,
choices
=
[
"Just resize"
,
"Crop and resize"
,
"Resize and fill"
,
"Just resize (latent upscale)"
],
type
=
"index"
,
value
=
"Just resize"
)
scripts
.
scripts_img2img
.
prepare_ui
()
for
category
in
ordered_ui_categories
():
if
category
==
"sampler"
:
steps
,
sampler_name
=
create_sampler_and_steps_selection
(
sd_samplers
.
visible_sampler_names
(),
"img2img"
)
elif
category
==
"dimensions"
:
with
FormRow
():
with
gr
.
Column
(
elem_id
=
"img2img_column_size"
,
scale
=
4
):
...
...
@@ -740,7 +691,7 @@ def create_ui():
if
category
not
in
{
"accordions"
}:
scripts
.
scripts_img2img
.
setup_ui_for_section
(
category
)
def
select_img2img_tab
(
tab
):
return
gr
.
update
(
visible
=
tab
in
[
2
,
3
,
4
]),
gr
.
update
(
visible
=
tab
==
3
),
...
...
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