Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
04ae857
1
Parent(s):
2a3b53f
Convert image path to PIL
Browse files
app.py
CHANGED
@@ -442,6 +442,7 @@ def encode_image(image):
|
|
442 |
return f"data:image/png;base64,{encoded_image}"
|
443 |
|
444 |
def generate_ai_bg(input_img, prompt):
|
|
|
445 |
hf_input_img = encode_image(input_img)
|
446 |
|
447 |
handler = fal_client.submit(
|
@@ -459,9 +460,11 @@ def generate_ai_bg(input_img, prompt):
|
|
459 |
|
460 |
result = fal_client.result("fal-ai/iclight-v2", request_id)
|
461 |
|
462 |
-
|
463 |
|
464 |
-
|
|
|
|
|
465 |
|
466 |
def blend_details(input_image, relit_image, masked_image, scaling_factor=1):
|
467 |
|
|
|
442 |
return f"data:image/png;base64,{encoded_image}"
|
443 |
|
444 |
def generate_ai_bg(input_img, prompt):
|
445 |
+
input_img = resize_image(input_img, 0.01)
|
446 |
hf_input_img = encode_image(input_img)
|
447 |
|
448 |
handler = fal_client.submit(
|
|
|
460 |
|
461 |
result = fal_client.result("fal-ai/iclight-v2", request_id)
|
462 |
|
463 |
+
relight_img_path = result['images'][0]['url']
|
464 |
|
465 |
+
relight_img = Image.open(relight_img_path).convert("RGBA")
|
466 |
+
|
467 |
+
return relight_img
|
468 |
|
469 |
def blend_details(input_image, relit_image, masked_image, scaling_factor=1):
|
470 |
|