Skip to content

Commit df42566

Browse files
gokayfemaykutkardasSBrandeis
authored
[Inference] Add more fal.ai models (huggingface#1139)
adds more fal.ai models --------- Co-authored-by: Aykut Kardaş <[email protected]> Co-authored-by: SBrandeis <[email protected]>
1 parent 3d5717a commit df42566

File tree

3 files changed

+236
-1
lines changed

3 files changed

+236
-1
lines changed

packages/inference/src/providers/fal-ai.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export const FAL_AI_SUPPORTED_MODEL_IDS: ProviderMapping<FalAiId> = {
1515
"Warlord-K/Sana-1024": "fal-ai/sana",
1616
"fal/AuraFlow-v0.2": "fal-ai/aura-flow",
1717
"stabilityai/stable-diffusion-3.5-large": "fal-ai/stable-diffusion-v35-large",
18+
"stabilityai/stable-diffusion-3.5-large-turbo": "fal-ai/stable-diffusion-v35-large/turbo",
19+
"stabilityai/stable-diffusion-3.5-medium": "fal-ai/stable-diffusion-v35-medium",
1820
"Kwai-Kolors/Kolors": "fal-ai/kolors",
1921
},
2022
"automatic-speech-recognition": {
@@ -23,5 +25,7 @@ export const FAL_AI_SUPPORTED_MODEL_IDS: ProviderMapping<FalAiId> = {
2325
"text-to-video": {
2426
"genmo/mochi-1-preview": "fal-ai/mochi-v1",
2527
"tencent/HunyuanVideo": "fal-ai/hunyuan-video",
28+
"THUDM/CogVideoX-5b": "fal-ai/cogvideox-5b",
29+
"Lightricks/LTX-Video": "fal-ai/ltx-video",
2630
},
2731
};

packages/inference/test/HfInference.spec.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ describe.concurrent("HfInference", () => {
816816

817817
it("textToVideo - HunyuanVideo", async () => {
818818
const res = await textToVideo({
819-
model: "genmo/mochi-1-preview",
819+
model: "tencent/HunyuanVideo",
820820
inputs: "A running dog",
821821
parameters: {
822822
seed: 176,
@@ -829,6 +829,34 @@ describe.concurrent("HfInference", () => {
829829
});
830830
expect(res).toBeInstanceOf(Blob);
831831
});
832+
833+
it("textToVideo - CogVideoX-5b", async () => {
834+
const res = await textToVideo({
835+
model: "THUDM/CogVideoX-5b",
836+
inputs: "A running dog",
837+
parameters: {
838+
seed: 176,
839+
num_frames: 2,
840+
},
841+
provider: "fal-ai",
842+
accessToken: env.HF_FAL_KEY,
843+
});
844+
expect(res).toBeInstanceOf(Blob);
845+
});
846+
847+
it("textToVideo - LTX-Video", async () => {
848+
const res = await textToVideo({
849+
model: "Lightricks/LTX-Video",
850+
inputs: "A running dog",
851+
parameters: {
852+
seed: 176,
853+
num_inference_steps: 2,
854+
},
855+
provider: "fal-ai",
856+
accessToken: env.HF_FAL_KEY,
857+
});
858+
expect(res).toBeInstanceOf(Blob);
859+
});
832860
},
833861
TIMEOUT
834862
);

packages/inference/test/tapes.json

Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5573,5 +5573,208 @@
55735573
"server": "UploadServer"
55745574
}
55755575
}
5576+
},
5577+
"4344ffbeb1704c351d762d39a62cd31bb54ab341ae6019362b31e48e43eef5b3": {
5578+
"url": "https://fal.run/fal-ai/stable-diffusion-v35-large/turbo",
5579+
"init": {
5580+
"headers": {
5581+
"Content-Type": "application/json"
5582+
},
5583+
"method": "POST",
5584+
"body": "{\"response_format\":\"base64\",\"prompt\":\"Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth.\"}"
5585+
},
5586+
"response": {
5587+
"body": "{\"images\":[{\"url\":\"https://fal.media/files/rabbit/tmqo7tjWZYVJjeNwFyVHQ.jpeg\",\"width\":1024,\"height\":768,\"content_type\":\"image/jpeg\"}],\"timings\":{\"inference\":0.8987537469947711},\"seed\":2647244993343975400,\"has_nsfw_concepts\":[false],\"prompt\":\"Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth.\"}",
5588+
"status": 200,
5589+
"statusText": "OK",
5590+
"headers": {
5591+
"connection": "keep-alive",
5592+
"content-type": "application/json",
5593+
"strict-transport-security": "max-age=31536000; includeSubDomains"
5594+
}
5595+
}
5596+
},
5597+
"3613cf546d2ea01fe1fb49de890985c07a1eccc387bc93d16e15943ba844ff33": {
5598+
"url": "https://fal.run/fal-ai/stable-diffusion-v35-medium",
5599+
"init": {
5600+
"headers": {
5601+
"Content-Type": "application/json"
5602+
},
5603+
"method": "POST",
5604+
"body": "{\"response_format\":\"base64\",\"prompt\":\"Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth.\"}"
5605+
},
5606+
"response": {
5607+
"body": "{\"images\":[{\"url\":\"https://fal.media/files/panda/G9jh2Jr2AlDQouQsyQLgt.jpeg\",\"width\":1024,\"height\":768,\"content_type\":\"image/jpeg\"}],\"timings\":{\"inference\":1.5137374009937048},\"seed\":15169059293161724000,\"has_nsfw_concepts\":[false],\"prompt\":\"Extreme close-up of a single tiger eye, direct frontal view. Detailed iris and pupil. Sharp focus on eye texture and color. Natural lighting to capture authentic eye shine and depth.\"}",
5608+
"status": 200,
5609+
"statusText": "OK",
5610+
"headers": {
5611+
"connection": "keep-alive",
5612+
"content-type": "application/json",
5613+
"strict-transport-security": "max-age=31536000; includeSubDomains"
5614+
}
5615+
}
5616+
},
5617+
"69404050795988722d8018d8868c73861e87c1a689d825af60d45e44500c38c6": {
5618+
"url": "https://fal.media/files/panda/G9jh2Jr2AlDQouQsyQLgt.jpeg",
5619+
"init": {},
5620+
"response": {
5621+
"body": "",
5622+
"status": 200,
5623+
"statusText": "OK",
5624+
"headers": {
5625+
"access-control-allow-headers": "*",
5626+
"access-control-allow-methods": "*",
5627+
"access-control-allow-origin": "*",
5628+
"access-control-max-age": "86400",
5629+
"cf-ray": "908ff35448182a0e-CDG",
5630+
"connection": "keep-alive",
5631+
"content-type": "image/jpeg",
5632+
"server": "cloudflare",
5633+
"vary": "Accept-Encoding"
5634+
}
5635+
}
5636+
},
5637+
"4ee8a4fd0cd802f24dcc484bcec15bf232e5d3cc88268b70c8e4969b452afe67": {
5638+
"url": "https://fal.media/files/rabbit/tmqo7tjWZYVJjeNwFyVHQ.jpeg",
5639+
"init": {},
5640+
"response": {
5641+
"body": "",
5642+
"status": 200,
5643+
"statusText": "OK",
5644+
"headers": {
5645+
"access-control-allow-headers": "*",
5646+
"access-control-allow-methods": "*",
5647+
"access-control-allow-origin": "*",
5648+
"access-control-max-age": "86400",
5649+
"cf-ray": "908ff3512eaa3ccb-CDG",
5650+
"connection": "keep-alive",
5651+
"content-type": "image/jpeg",
5652+
"server": "cloudflare",
5653+
"vary": "Accept-Encoding"
5654+
}
5655+
}
5656+
},
5657+
"8e5cd052a79581ad4c5002962c93746ffb9587cff4c55ae8b33f85e0bb6a2fdd": {
5658+
"url": "https://fal.run/fal-ai/ltx-video",
5659+
"init": {
5660+
"headers": {
5661+
"Content-Type": "application/json"
5662+
},
5663+
"method": "POST",
5664+
"body": "{\"seed\":176,\"num_inference_steps\":2,\"prompt\":\"A running dog\"}"
5665+
},
5666+
"response": {
5667+
"body": "{\"video\":{\"url\":\"https://v3.fal.media/files/kangaroo/IZn0hEJxd5OoapfNX6rSq_tmpfperp_j6.mp4\",\"content_type\":\"application/octet-stream\",\"file_name\":\"tmpfperp_j6.mp4\",\"file_size\":9669497},\"seed\":176}",
5668+
"status": 200,
5669+
"statusText": "OK",
5670+
"headers": {
5671+
"connection": "keep-alive",
5672+
"content-type": "application/json",
5673+
"strict-transport-security": "max-age=31536000; includeSubDomains"
5674+
}
5675+
}
5676+
},
5677+
"4788fdd7d1d4311ec83fa1208de829b16e6b044607ecb4a7838eebc72114a921": {
5678+
"url": "https://v3.fal.media/files/kangaroo/IZn0hEJxd5OoapfNX6rSq_tmpfperp_j6.mp4",
5679+
"init": {},
5680+
"response": {
5681+
"body": "",
5682+
"status": 200,
5683+
"statusText": "OK",
5684+
"headers": {
5685+
"accept-ranges": "bytes",
5686+
"access-control-allow-headers": "*",
5687+
"access-control-allow-methods": "*",
5688+
"access-control-allow-origin": "*",
5689+
"access-control-max-age": "86400",
5690+
"cf-ray": "908ff376b8aff120-CDG",
5691+
"connection": "keep-alive",
5692+
"content-type": "application/octet-stream",
5693+
"server": "cloudflare",
5694+
"vary": "Accept-Encoding"
5695+
}
5696+
}
5697+
},
5698+
"e4c01272acc7b4b098731e451e96b8d0b087d4c72543f1a8b97cdf1834aabe27": {
5699+
"url": "https://fal.run/fal-ai/cogvideox-5b",
5700+
"init": {
5701+
"headers": {
5702+
"Content-Type": "application/json"
5703+
},
5704+
"method": "POST",
5705+
"body": "{\"seed\":176,\"num_frames\":2,\"prompt\":\"A running dog\"}"
5706+
},
5707+
"response": {
5708+
"body": "{\"video\":{\"url\":\"https://v3.fal.media/files/penguin/YvilKeP7JL45cNmlJW8hP_tmp.mp4\",\"content_type\":\"application/octet-stream\",\"file_name\":\"tmp.mp4\",\"file_size\":4156439},\"timings\":{\"inference\":58.29187552398071},\"seed\":176,\"prompt\":\"A running dog\"}",
5709+
"status": 200,
5710+
"statusText": "OK",
5711+
"headers": {
5712+
"connection": "keep-alive",
5713+
"content-type": "application/json",
5714+
"strict-transport-security": "max-age=31536000; includeSubDomains"
5715+
}
5716+
}
5717+
},
5718+
"df62590fb03c7398302c98c0b5d5d1a7d75f77941a9b92be1682b94111e7344a": {
5719+
"url": "https://v3.fal.media/files/penguin/YvilKeP7JL45cNmlJW8hP_tmp.mp4",
5720+
"init": {},
5721+
"response": {
5722+
"body": "",
5723+
"status": 200,
5724+
"statusText": "OK",
5725+
"headers": {
5726+
"accept-ranges": "bytes",
5727+
"access-control-allow-headers": "*",
5728+
"access-control-allow-methods": "*",
5729+
"access-control-allow-origin": "*",
5730+
"access-control-max-age": "86400",
5731+
"cf-ray": "908ff4b64b0cd156-CDG",
5732+
"connection": "keep-alive",
5733+
"content-type": "application/octet-stream",
5734+
"server": "cloudflare",
5735+
"vary": "Accept-Encoding"
5736+
}
5737+
}
5738+
},
5739+
"0abfddc21aaed8b0b716c10a867e23fd10a779863512f2bcf10d2d97b47e8c31": {
5740+
"url": "https://fal.run/fal-ai/hunyuan-video",
5741+
"init": {
5742+
"headers": {
5743+
"Content-Type": "application/json"
5744+
},
5745+
"method": "POST",
5746+
"body": "{\"seed\":176,\"num_inference_steps\":2,\"num_frames\":85,\"resolution\":\"480p\",\"prompt\":\"A running dog\"}"
5747+
},
5748+
"response": {
5749+
"body": "{\"video\":{\"url\":\"https://v3.fal.media/files/rabbit/L6wJQvUds5HsTUGLZe9Bp_video-1738056610.mp4\",\"content_type\":\"application/octet-stream\",\"file_name\":\"video-1738056610.mp4\",\"file_size\":216048},\"seed\":176}",
5750+
"status": 200,
5751+
"statusText": "OK",
5752+
"headers": {
5753+
"connection": "keep-alive",
5754+
"content-type": "application/json",
5755+
"strict-transport-security": "max-age=31536000; includeSubDomains"
5756+
}
5757+
}
5758+
},
5759+
"b1b02865c69c8ae30637b72442f9c8f21d15f6d2af0081e5de5d59fbfd3d2d41": {
5760+
"url": "https://v3.fal.media/files/rabbit/L6wJQvUds5HsTUGLZe9Bp_video-1738056610.mp4",
5761+
"init": {},
5762+
"response": {
5763+
"body": "",
5764+
"status": 200,
5765+
"statusText": "OK",
5766+
"headers": {
5767+
"accept-ranges": "bytes",
5768+
"access-control-allow-headers": "*",
5769+
"access-control-allow-methods": "*",
5770+
"access-control-allow-origin": "*",
5771+
"access-control-max-age": "86400",
5772+
"cf-ray": "908ff665ca2d2a03-CDG",
5773+
"connection": "keep-alive",
5774+
"content-type": "application/octet-stream",
5775+
"server": "cloudflare",
5776+
"vary": "Accept-Encoding"
5777+
}
5778+
}
55765779
}
55775780
}

0 commit comments

Comments
 (0)