This application automates the process of creating product commercials by leveraging AI-generated content and user-provided assets.
- LoRA Model Training: Train custom LoRA models using your own image datasets.
- AI Image Generation: Generate product images using trained LoRA models.
- Video Generation: Create dynamic product videos from generated images.
- B-roll Integration: Upload and incorporate B-roll footage into your commercials.
- AI Music Generation: Generate background music for your commercials using AI.
- Video Stitching: Combine product videos, B-roll footage, and music into a final commercial.
-
Clone this repository:
git clone https://github.com/yourusername/auto-product-commercial.git cd auto-product-commercial
-
Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the root directory and add the following:FAL_API_KEY=your_fal_api_key ANTHROPIC_API_KEY=your_anthropic_api_key
-
Run the Gradio app:
python app.py
-
Open your web browser and navigate to the local URL provided by Gradio (usually
http://127.0.0.1:7860
). -
Follow the steps in the UI to:
- Train a LoRA model
- Generate images using the trained model
- Create product videos
- Upload B-roll footage
- Generate background music
- Stitch everything together into a final commercial
app.py
: Main application file containing the Gradio interface and core logic.edit_picture.py
: Image processing utilities.flux.py
: FluxImageGenerator for image generation.runway.py
: FalVideoGenerator for video generation.suno.py
: SongGenerator for AI music generation.fal_train_lora.py
: LoraTrainer for custom LoRA model training.fal_lora_inference.py
: FalLoraInference for generating images with trained LoRA models.
- gradio
- Pillow
- moviepy
- numpy
- anthropic
- (other dependencies as listed in requirements.txt)
Contributions are welcome! Please feel free to submit a Pull Request.