Skip to content

Add AI video generator FastAPI app with web UI and image->MP4 pipeline#2

Open
reoreoxzkami wants to merge 2 commits into
mainfrom
codex/create-ai-video-generation-app-p2e5b8
Open

Add AI video generator FastAPI app with web UI and image->MP4 pipeline#2
reoreoxzkami wants to merge 2 commits into
mainfrom
codex/create-ai-video-generation-app-p2e5b8

Conversation

@reoreoxzkami
Copy link
Copy Markdown
Owner

Motivation

  • Provide a simple web application that generates short MP4 videos from text prompts by composing AI-generated or fallback images.
  • Include a lightweight browser UI for prompt entry, preview, and download of generated videos.
  • Support using OpenAI gpt-image-1 when OPENAI_API_KEY is available with a graceful fallback when not.

Description

  • Add main.py which implements a FastAPI app with endpoints GET / (UI), POST /generate, GET /download/{file_name}, and GET /video/{file_name} and mounts /static and Jinja templates.
  • Implement image generation via _openai_images that calls OpenAI images API (gpt-image-1) or _fallback_image that creates a gradient + prompt overlay when no API key is present.
  • Build video files by concatenating frames with MoviePy in _build_video and save outputs to the generated/ directory.
  • Add templates/index.html browser UI for prompt/scene configuration and client-side handling to call POST /generate and preview/download results.
  • Add requirements.txt for dependencies and README.md with setup and usage instructions and uvicorn startup example.

Testing

  • No automated tests were added or executed for this change.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread main.py
from PIL import Image, ImageDraw

app = FastAPI(title="AI Video Generator")
app.mount("/static", StaticFiles(directory="static"), name="static")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant