ssboost commited on
Commit
4a81895
·
verified ·
1 Parent(s): c59923b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -125,6 +125,12 @@ with gr.Blocks(css=css) as Kolors:
125
  )
126
  with gr.Row():
127
  ip_adapter_image = gr.Image(label="Image Prompt (optional)", type="pil")
 
 
 
 
 
 
128
  with gr.Row(visible=False): # Advanced Settings 숨김
129
  negative_prompt = gr.Textbox(
130
  label="Negative prompt",
 
125
  )
126
  with gr.Row():
127
  ip_adapter_image = gr.Image(label="Image Prompt (optional)", type="pil")
128
+ # 이미지를 업로드하면 해당 이미지의 가로, 세로 크기를 자동으로 감지하여 슬라이더에 반영
129
+ ip_adapter_image.change(
130
+ lambda img: (img.width, img.height) if img else (1024, 1024), # 기본값 1024x1024
131
+ inputs=ip_adapter_image,
132
+ outputs=[width, height] # 가로와 세로 슬라이더에 값 반영
133
+ )
134
  with gr.Row(visible=False): # Advanced Settings 숨김
135
  negative_prompt = gr.Textbox(
136
  label="Negative prompt",