Add AI video generator FastAPI app with web UI and image->MP4 pipeline#2
Add AI video generator FastAPI app with web UI and image->MP4 pipeline#2reoreoxzkami wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 72b9c15c4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| from PIL import Image, ImageDraw | ||
|
|
||
| app = FastAPI(title="AI Video Generator") | ||
| app.mount("/static", StaticFiles(directory="static"), name="static") |
There was a problem hiding this comment.
Ensure static directory exists before mounting
StaticFiles(directory="static") validates the directory at startup, but this commit does not add a static/ folder, so a fresh checkout following the README will fail to boot with a runtime error before any endpoint is served. This makes the app unusable out of the box unless users manually create an empty directory.
Useful? React with 👍 / 👎.
Motivation
gpt-image-1whenOPENAI_API_KEYis available with a graceful fallback when not.Description
main.pywhich implements a FastAPI app with endpointsGET /(UI),POST /generate,GET /download/{file_name}, andGET /video/{file_name}and mounts/staticand Jinja templates._openai_imagesthat calls OpenAI images API (gpt-image-1) or_fallback_imagethat creates a gradient + prompt overlay when no API key is present._build_videoand save outputs to thegenerated/directory.templates/index.htmlbrowser UI for prompt/scene configuration and client-side handling to callPOST /generateand preview/download results.requirements.txtfor dependencies andREADME.mdwith setup and usage instructions anduvicornstartup example.Testing
Codex Task