Loading...
Loading...
End-to-end video generation via fal.ai through Starchild paid proxy. Covers text-to-video, image-to-video, video-to-video, model selection, billing, polling, and serving local reference assets via a public preview.
npx skill4agent add starchild-ai-agent/official-skills videoexec(open('skills/video/generate_video.py').read())
result = generate_video(
prompt="A cinematic drone shot over snowy mountains at sunrise",
model="balanced", # "budget" | "balanced" | "premium"
duration=5,
)
# result -> {"success": True, "cost": 0.70, "video_url": "...", "local_path": "output/videos/..."}generate_videooutput/videos/video_urlhttps://*.fal.media/.../*.mp4Content-Security-Policy: sandbox; default-src 'none'<video><iframe>Content-Disposition: attachment?download=1result["local_path"]output/videos/xxx.mp4generate_videooutput/videos/<filename>[video](output/videos/<filename>.mp4)send_to_telegram(file_path="output/videos/...", message_type="video")send_to_wechat(file_path="output/videos/...", message_type="video")local_pathcurl -L -o output/videos/<filename>.mp4 "<video_url>"output/fal_assets/publish_asset.pyfal-assets<preview_base>/<filename>generate_video(... image_url=public_url)# Step 1: publish a local image into the asset folder
exec(open('skills/video/publish_asset.py').read())
asset = publish_local('/path/to/your/photo.jpg')
# or: publish_from_url('https://example.com/photo.jpg')
filename = asset['filename']
# Step 2: combine with the preview's public base URL (see §3)
public_url = f"https://community.iamstarchild.com/<user_slug>-fal-assets/{filename}"
# Step 3: image-to-video
exec(open('skills/video/generate_video.py').read())
result = generate_video(
prompt="gentle cinematic camera push-in",
model="balanced",
duration=5,
image_url=public_url,
)generate_video*/text-to-video*/image-to-videoimage_urlpublish_asset.py.jpg .jpeg .png .webp .gif .bmp.mp4 .mov .webm .mkv .m4vfal-assets# 3.1 ensure the asset folder exists with a placeholder index
import os, pathlib
pathlib.Path('output/fal_assets').mkdir(parents=True, exist_ok=True)
if not os.path.exists('output/fal_assets/index.html'):
open('output/fal_assets/index.html', 'w').write(
'<!doctype html><html><body><h1>fal asset host</h1></body></html>'
)
# 3.2 start the preview
preview(action='serve', dir='output/fal_assets', title='fal-assets')
# 3.3 publish to a public URL
preview(action='publish', preview_id='<id from step 3.2>', slug='fal-assets', title='fal-assets')
# → public base: https://community.iamstarchild.com/<user_slug>-fal-assets/output/fal_assets/<base>/<filename>curl -sI https://community.iamstarchild.com/<user_slug>-fal-assets/<filename>
# expect: HTTP/2 200, content-type: image/* or video/*preview(action='serve')No available ports in pool| Tier | Model | Cost / 5s | Notes |
|---|---|---|---|
| budget | | $0.25 | Fastest, cheapest; good for prompt iteration |
| balanced | | $0.70 | Default; best lip-sync, most use cases |
| premium | | $1.20 | Best motion + camera direction |
generate_video(model=...)text-to-videoimage-to-videogenerate_video.py::estimate_costexec(open('skills/video/poll_status.py').read())
result = poll_video("019ded6c-d871-7290-bbf1-ddc6993f8958")generate_videorequest_idgenerate_video.pypublish_asset.pyoutput/fal_assets/fal-assetspoll_status.pyrequest_id| Problem | Fix |
|---|---|
| Use |
| Ask the user which preview to stop; do not auto-kill |
| Reference asset host failed mid-render — re-encode/resize to 16:9, re-publish, retry |
| Top up balance; cost is pre-charged on submit |
| sc-proxy only allows approved fal video endpoints; pick one from the model table |
Generation | Shorten prompt, drop unusual tokens, retry once before changing model |
Job stuck | Save |
| User reports the fal.media link "shows nothing" / "blank page" | Expected — fal serves with |
sc-proxyqueue.fal.runapi.fal.aiAuthorization: Key fake-falai-key-12345FAL_KEY403 endpoint_not_allowedhttps://*.fal.media/...generate_video.py::estimate_costtransparent-proxy/apis/falai.py::_VIDEO_PRICINGFAL_KEY