refactor detailer

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-01-07 10:12:47 -05:00
parent 19d56d3342
commit 5593ea78a9
21 changed files with 142 additions and 82 deletions
-15
View File
@@ -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: