Skip to content

Commit 986c31d

Browse files
Merge pull request AUTOMATIC1111#16180 from light-and-ray/do_not_send_image_size_on_paste_inpaint
do not send image size on paste inpaint
2 parents 5096c16 + d57ff88 commit 986c31d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/infotext_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,19 @@ def connect_paste_params_buttons():
146146
destination_height_component = next(iter([field for field, name in fields if name == "Size-2"] if fields else []), None)
147147

148148
if binding.source_image_component and destination_image_component:
149+
need_send_dementions = destination_width_component and binding.tabname != 'inpaint'
149150
if isinstance(binding.source_image_component, gr.Gallery):
150-
func = send_image_and_dimensions if destination_width_component else image_from_url_text
151+
func = send_image_and_dimensions if need_send_dementions else image_from_url_text
151152
jsfunc = "extract_image_from_gallery"
152153
else:
153-
func = send_image_and_dimensions if destination_width_component else lambda x: x
154+
func = send_image_and_dimensions if need_send_dementions else lambda x: x
154155
jsfunc = None
155156

156157
binding.paste_button.click(
157158
fn=func,
158159
_js=jsfunc,
159160
inputs=[binding.source_image_component],
160-
outputs=[destination_image_component, destination_width_component, destination_height_component] if destination_width_component else [destination_image_component],
161+
outputs=[destination_image_component, destination_width_component, destination_height_component] if need_send_dementions else [destination_image_component],
161162
show_progress=False,
162163
)
163164

0 commit comments

Comments
 (0)