Spaces:
Running
Running
Changes to be committed:
Browse files
app.py
CHANGED
|
@@ -55,13 +55,9 @@ def image_to_image(prompt, image, dimension, flux_client):
|
|
| 55 |
input_image=handle_file(padded_image_path),
|
| 56 |
prompt=prompt,
|
| 57 |
guidance_scale=2.5,
|
| 58 |
-
negative_prompt=None,
|
| 59 |
-
nag_negative_prompt="Low resolution, blurry, lack of details",
|
| 60 |
-
nag_scale=3,
|
| 61 |
num_inference_steps=25,
|
| 62 |
randomize_seed=True,
|
| 63 |
-
|
| 64 |
-
api_name="/sample"
|
| 65 |
)
|
| 66 |
|
| 67 |
print(image)
|
|
@@ -70,7 +66,7 @@ def image_to_image(prompt, image, dimension, flux_client):
|
|
| 70 |
os.remove(padded_image_path)
|
| 71 |
except:
|
| 72 |
pass
|
| 73 |
-
return image[0]
|
| 74 |
|
| 75 |
def image_to_video(prompt, image, ltx_client):
|
| 76 |
result = ltx_client.predict(
|
|
@@ -86,7 +82,7 @@ def image_to_video(prompt, image, ltx_client):
|
|
| 86 |
|
| 87 |
def personalized_video(prompt, image, dimension, request: gr.Request):
|
| 88 |
x_ip_token = request.headers['x-ip-token']
|
| 89 |
-
flux_client = Client("
|
| 90 |
ltx_client = Client("KingNish/ltx-video-distilled", headers={"x-ip-token": x_ip_token})
|
| 91 |
image = image_to_image(prompt, image, dimension, flux_client)
|
| 92 |
yield image, None
|
|
|
|
| 55 |
input_image=handle_file(padded_image_path),
|
| 56 |
prompt=prompt,
|
| 57 |
guidance_scale=2.5,
|
|
|
|
|
|
|
|
|
|
| 58 |
num_inference_steps=25,
|
| 59 |
randomize_seed=True,
|
| 60 |
+
api_name="/infer"
|
|
|
|
| 61 |
)
|
| 62 |
|
| 63 |
print(image)
|
|
|
|
| 66 |
os.remove(padded_image_path)
|
| 67 |
except:
|
| 68 |
pass
|
| 69 |
+
return image[0]
|
| 70 |
|
| 71 |
def image_to_video(prompt, image, ltx_client):
|
| 72 |
result = ltx_client.predict(
|
|
|
|
| 82 |
|
| 83 |
def personalized_video(prompt, image, dimension, request: gr.Request):
|
| 84 |
x_ip_token = request.headers['x-ip-token']
|
| 85 |
+
flux_client = Client("black-forest-labs/FLUX.1-Kontext-Dev", headers={"x-ip-token": x_ip_token})
|
| 86 |
ltx_client = Client("KingNish/ltx-video-distilled", headers={"x-ip-token": x_ip_token})
|
| 87 |
image = image_to_image(prompt, image, dimension, flux_client)
|
| 88 |
yield image, None
|