mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
@@ -63,21 +63,6 @@ def create_toprow(is_img2img: bool = False, id_part: str = None):
|
||||
|
||||
|
||||
def ar_change(ar, width, height):
|
||||
"""
|
||||
if ar == 'AR':
|
||||
return gr.update(interactive=True), gr.update(interactive=True)
|
||||
try:
|
||||
(w, h) = [float(x) for x in ar.split(':')]
|
||||
except Exception as e:
|
||||
shared.log.warning(f"Invalid aspect ratio: {ar} {e}")
|
||||
return gr.update(interactive=True), gr.update(interactive=True)
|
||||
if w > h:
|
||||
return gr.update(interactive=True, value=width), gr.update(interactive=False, value=int(width * h / w))
|
||||
elif w < h:
|
||||
return gr.update(interactive=False, value=int(height * w / h)), gr.update(interactive=True, value=height)
|
||||
else:
|
||||
return gr.update(interactive=True, value=width), gr.update(interactive=False, value=width)
|
||||
"""
|
||||
if ar == 'AR':
|
||||
return gr.update(), gr.update()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user