Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
cbbda4b
1
Parent(s):
41d5922
Debug
Browse files
app.py
CHANGED
@@ -349,26 +349,24 @@ def encode_image(image):
|
|
349 |
def generate_ai_bg(input_img, prompt):
|
350 |
hf_input_img = encode_image(input_img)
|
351 |
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
|
361 |
-
|
362 |
|
363 |
-
|
364 |
|
365 |
-
|
366 |
|
367 |
-
|
368 |
|
369 |
-
|
370 |
-
|
371 |
-
return hf_input_img
|
372 |
|
373 |
def generate_image(input_img, prompt):
|
374 |
ai_gen_image = generate_ai_bg(input_img, prompt)
|
|
|
349 |
def generate_ai_bg(input_img, prompt):
|
350 |
hf_input_img = encode_image(input_img)
|
351 |
|
352 |
+
handler = fal_client.submit(
|
353 |
+
"fal-ai/iclight-v2",
|
354 |
+
arguments={
|
355 |
+
"prompt": prompt,
|
356 |
+
"image_url": hf_input_img
|
357 |
+
},
|
358 |
+
webhook_url="https://optional.webhook.url/for/results",
|
359 |
+
)
|
360 |
|
361 |
+
request_id = handler.request_id
|
362 |
|
363 |
+
status = fal_client.status("fal-ai/iclight-v2", request_id, with_logs=True)
|
364 |
|
365 |
+
result = fal_client.result("fal-ai/iclight-v2", request_id)
|
366 |
|
367 |
+
ic_light_img = result['images'][0]['url']
|
368 |
|
369 |
+
return ic_light_img
|
|
|
|
|
370 |
|
371 |
def generate_image(input_img, prompt):
|
372 |
ai_gen_image = generate_ai_bg(input_img, prompt)
|