Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -324,12 +324,7 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as dalle:
|
|
324 |
"Stable Diffusion 3.5 Large",
|
325 |
"Stable Diffusion 3.5 Large Turbo",
|
326 |
"Stable Diffusion XL",
|
327 |
-
"FLUX.1 [Schnell]"
|
328 |
-
"FLUX.1 [Dev]",
|
329 |
-
"Midjourney",
|
330 |
-
"DreamPhotoGASM",
|
331 |
-
"Disney",
|
332 |
-
"Leonardo AI Style Illustration"
|
333 |
]
|
334 |
|
335 |
# 전체 모델 리스트
|
@@ -368,10 +363,10 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as dalle:
|
|
368 |
"Collage Flux"
|
369 |
]
|
370 |
|
371 |
-
model = gr.Radio
|
372 |
-
label="Select
|
373 |
choices=models_list,
|
374 |
-
value=
|
375 |
interactive=True
|
376 |
)
|
377 |
|
@@ -388,19 +383,6 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as dalle:
|
|
388 |
height="auto"
|
389 |
)
|
390 |
|
391 |
-
# 2x2 그리드 생성 함수
|
392 |
-
def generate_grid(prompt, model, custom_lora, negative_prompt, steps, cfg_scale, seed, strength, width, height):
|
393 |
-
images = []
|
394 |
-
for i in range(4):
|
395 |
-
current_seed = random.randint(1, 1000000000) if seed == -1 else seed + i
|
396 |
-
try:
|
397 |
-
img = query(prompt, model, custom_lora, negative_prompt, steps, cfg_scale, current_seed, strength, width, height)
|
398 |
-
images.append(img)
|
399 |
-
except Exception as e:
|
400 |
-
print(f"Error generating image {i+1}: {str(e)}")
|
401 |
-
continue
|
402 |
-
return images
|
403 |
-
|
404 |
# 이벤트 핸들러
|
405 |
generate_btn.click(
|
406 |
fn=generate_grid,
|
@@ -421,7 +403,7 @@ with gr.Blocks(theme="Yntec/HaleyCH_Theme_Orange", css=css) as dalle:
|
|
421 |
|
422 |
def filter_models(search_term):
|
423 |
filtered_models = [m for m in models_list if search_term.lower() in m.lower()]
|
424 |
-
return gr.update(choices=filtered_models)
|
425 |
|
426 |
model_search.change(filter_models, inputs=model_search, outputs=model)
|
427 |
|
|
|
324 |
"Stable Diffusion 3.5 Large",
|
325 |
"Stable Diffusion 3.5 Large Turbo",
|
326 |
"Stable Diffusion XL",
|
327 |
+
"FLUX.1 [Schnell]"
|
|
|
|
|
|
|
|
|
|
|
328 |
]
|
329 |
|
330 |
# 전체 모델 리스트
|
|
|
363 |
"Collage Flux"
|
364 |
]
|
365 |
|
366 |
+
model = gr.Checkboxgroup( # Radio를 Checkboxgroup으로 변경
|
367 |
+
label="Select Models (Choose up to 4)",
|
368 |
choices=models_list,
|
369 |
+
value=default_models, # 기본값으로 상위 4개 선택
|
370 |
interactive=True
|
371 |
)
|
372 |
|
|
|
383 |
height="auto"
|
384 |
)
|
385 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
# 이벤트 핸들러
|
387 |
generate_btn.click(
|
388 |
fn=generate_grid,
|
|
|
403 |
|
404 |
def filter_models(search_term):
|
405 |
filtered_models = [m for m in models_list if search_term.lower() in m.lower()]
|
406 |
+
return gr.update(choices=filtered_models, value=[])
|
407 |
|
408 |
model_search.change(filter_models, inputs=model_search, outputs=model)
|
409 |
|