Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -163,6 +163,7 @@ def infer_canny(prompt, text_for_image, text_position, font_size,
|
|
| 163 |
control_guidance_end = 0.9,
|
| 164 |
strength = 1.0
|
| 165 |
):
|
|
|
|
| 166 |
prompt = translate_korean_to_english(prompt)
|
| 167 |
negative_prompt = translate_korean_to_english(negative_prompt)
|
| 168 |
|
|
@@ -176,6 +177,7 @@ def infer_canny(prompt, text_for_image, text_position, font_size,
|
|
| 176 |
|
| 177 |
pipe = pipe_canny.to("cuda")
|
| 178 |
condi_img = process_canny_condition(init_image)
|
|
|
|
| 179 |
image = pipe(
|
| 180 |
prompt=prompt,
|
| 181 |
image=init_image,
|
|
@@ -189,9 +191,7 @@ def infer_canny(prompt, text_for_image, text_position, font_size,
|
|
| 189 |
num_images_per_prompt=1,
|
| 190 |
generator=generator,
|
| 191 |
).images[0]
|
| 192 |
-
return
|
| 193 |
-
|
| 194 |
-
|
| 195 |
|
| 196 |
def update_button_states(selected_position):
|
| 197 |
return [
|
|
@@ -329,8 +329,9 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as Kolors:
|
|
| 329 |
with gr.Row():
|
| 330 |
canny_button = gr.Button("Start", elem_id="button")
|
| 331 |
|
|
|
|
| 332 |
with gr.Column(elem_id="col-right"):
|
| 333 |
-
result = gr.
|
| 334 |
seed_used = gr.Number(label="Seed Used")
|
| 335 |
|
| 336 |
canny_button.click(
|
|
@@ -338,6 +339,8 @@ with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as Kolors:
|
|
| 338 |
inputs = [prompt, text_for_image, text_position, font_size, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, controlnet_conditioning_scale, control_guidance_end, strength],
|
| 339 |
outputs = [result, seed_used]
|
| 340 |
)
|
|
|
|
|
|
|
| 341 |
|
| 342 |
# Set initial button states
|
| 343 |
Kolors.load(update_button_states, inputs=[text_position], outputs=position_buttons)
|
|
|
|
| 163 |
control_guidance_end = 0.9,
|
| 164 |
strength = 1.0
|
| 165 |
):
|
| 166 |
+
|
| 167 |
prompt = translate_korean_to_english(prompt)
|
| 168 |
negative_prompt = translate_korean_to_english(negative_prompt)
|
| 169 |
|
|
|
|
| 177 |
|
| 178 |
pipe = pipe_canny.to("cuda")
|
| 179 |
condi_img = process_canny_condition(init_image)
|
| 180 |
+
|
| 181 |
image = pipe(
|
| 182 |
prompt=prompt,
|
| 183 |
image=init_image,
|
|
|
|
| 191 |
num_images_per_prompt=1,
|
| 192 |
generator=generator,
|
| 193 |
).images[0]
|
| 194 |
+
return image, seed # CANNY 이미지 반환 제거
|
|
|
|
|
|
|
| 195 |
|
| 196 |
def update_button_states(selected_position):
|
| 197 |
return [
|
|
|
|
| 329 |
with gr.Row():
|
| 330 |
canny_button = gr.Button("Start", elem_id="button")
|
| 331 |
|
| 332 |
+
|
| 333 |
with gr.Column(elem_id="col-right"):
|
| 334 |
+
result = gr.Image(label="Result", show_label=False) # Gallery에서 Image로 변경
|
| 335 |
seed_used = gr.Number(label="Seed Used")
|
| 336 |
|
| 337 |
canny_button.click(
|
|
|
|
| 339 |
inputs = [prompt, text_for_image, text_position, font_size, negative_prompt, seed, randomize_seed, guidance_scale, num_inference_steps, controlnet_conditioning_scale, control_guidance_end, strength],
|
| 340 |
outputs = [result, seed_used]
|
| 341 |
)
|
| 342 |
+
|
| 343 |
+
|
| 344 |
|
| 345 |
# Set initial button states
|
| 346 |
Kolors.load(update_button_states, inputs=[text_position], outputs=position_buttons)
|