Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
e7b99fd
1
Parent(s):
143a0f1
Use filepath for input image
Browse files
app.py
CHANGED
@@ -468,7 +468,7 @@ def encode_image(image):
|
|
468 |
|
469 |
def generate_ai_bg(input_img, prompt):
|
470 |
# input_img = resize_image(input_img, 0.01)
|
471 |
-
hf_input_img = encode_image(input_img)
|
472 |
|
473 |
# handler = fal_client.submit(
|
474 |
# "fal-ai/iclight-v2",
|
@@ -495,7 +495,7 @@ def generate_ai_bg(input_img, prompt):
|
|
495 |
|
496 |
client = Client("lllyasviel/iclight-v2-vary")
|
497 |
result = client.predict(
|
498 |
-
input_fg=handle_file(
|
499 |
bg_source="None",
|
500 |
prompt=prompt,
|
501 |
image_width=896,
|
@@ -583,7 +583,7 @@ def blend_details(input_image, relit_image, masked_image, scaling_factor=1):
|
|
583 |
@spaces.GPU
|
584 |
def generate_image(input_img, prompt):
|
585 |
|
586 |
-
input_img = resize_to_square(input_img)
|
587 |
|
588 |
ai_gen_image = generate_ai_bg(input_img, prompt)
|
589 |
|
@@ -602,7 +602,7 @@ def create_ui():
|
|
602 |
|
603 |
with gr.Row():
|
604 |
with gr.Column():
|
605 |
-
input_image = gr.Image(type="
|
606 |
# ai_image = gr.Image(type="pil", label="image")
|
607 |
prompt = gr.Textbox(label="Prompt", placeholder="Enter your prompt here...")
|
608 |
run_button = gr.Button(value='Run')
|
|
|
468 |
|
469 |
def generate_ai_bg(input_img, prompt):
|
470 |
# input_img = resize_image(input_img, 0.01)
|
471 |
+
# hf_input_img = encode_image(input_img)
|
472 |
|
473 |
# handler = fal_client.submit(
|
474 |
# "fal-ai/iclight-v2",
|
|
|
495 |
|
496 |
client = Client("lllyasviel/iclight-v2-vary")
|
497 |
result = client.predict(
|
498 |
+
input_fg=handle_file(input_img),
|
499 |
bg_source="None",
|
500 |
prompt=prompt,
|
501 |
image_width=896,
|
|
|
583 |
@spaces.GPU
|
584 |
def generate_image(input_img, prompt):
|
585 |
|
586 |
+
# input_img = resize_to_square(input_img)
|
587 |
|
588 |
ai_gen_image = generate_ai_bg(input_img, prompt)
|
589 |
|
|
|
602 |
|
603 |
with gr.Row():
|
604 |
with gr.Column():
|
605 |
+
input_image = gr.Image(type="filepath", label="image")
|
606 |
# ai_image = gr.Image(type="pil", label="image")
|
607 |
prompt = gr.Textbox(label="Prompt", placeholder="Enter your prompt here...")
|
608 |
run_button = gr.Button(value='Run')
|