# Freepik AI CLI A sophisticated, beautiful command-line interface for the [Freepik AI API](https://docs.freepik.com/introduction) — generate images, animate videos, upscale media, and more, all from your terminal. ``` ███████╗██████╗ ███████╗███████╗██████╗ ██╗██╗ ██╗ ██╔════╝██╔══██╗██╔════╝██╔════╝██╔══██╗██║██║ ██╔╝ █████╗ ██████╔╝█████╗ █████╗ ██████╔╝██║█████╔╝ ██╔══╝ ██╔══██╗██╔══╝ ██╔══╝ ██╔═══╝ ██║██╔═██╗ ██║ ██║ ██║███████╗███████╗██║ ██║██║ ██╗ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝ AI Media Generation CLI • v0.1.0 ``` ## Features - **9 commands** covering image generation, video generation, upscaling, editing, and analysis - **Beautiful terminal UI** — live polling panels, progress bars, color-coded status, Rich-themed output - **15+ AI models** — Flux, Mystic, Seedream, Kling, Minimax, Runway, and more - **Async-first** — all long-running tasks poll with exponential backoff; use `--no-wait` for fire-and-forget - **Zero config required** — just set `FREEPIK_API_KEY` and go ## Installation ### Prerequisites - Python 3.11+ - A [Freepik API key](https://www.freepik.com/api) (free tier includes $5 credit) ### Setup ```bash git clone cd freepik python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -e . ``` ### API Key ```bash export FREEPIK_API_KEY=your_api_key_here ``` Or add it to a `.env` file in the project root (see `.env.example`). ## Quick Start ```bash # Generate an image freepik generate-image "a misty forest at dawn, cinematic lighting" # Animate an image into a video freepik generate-video photo.jpg --prompt "gentle camera drift" --duration 5 # Upscale an image 4x freepik upscale-image photo.jpg --mode precision-v2 --scale 4x # Upscale a video freepik upscale-video clip.mp4 --mode turbo # Describe an image (reverse-engineer its prompt) freepik describe-image painting.jpg ``` ## Commands ### `generate-image` Generate an image from a text prompt. ```bash freepik generate-image [OPTIONS] ``` | Option | Short | Default | Description | |--------|-------|---------|-------------| | `--model` | `-m` | `flux-2-pro` | AI model to use | | `--aspect-ratio` | `-a` | — | e.g. `16:9`, `1:1`, `9:16`, `4:3` | | `--negative-prompt` | `-n` | — | Concepts to exclude | | `--seed` | | — | Integer seed for reproducibility | | `--input-image` | `-i` | — | Reference image for img2img (flux-kontext-pro) | | `--output` | `-o` | auto | Output file path | | `--wait / --no-wait` | | `--wait` | Wait for completion or return task ID | | `--api-key` | | `$FREEPIK_API_KEY` | API key override | **Available models:** | Model | Description | |-------|-------------| | `flux-2-pro` | High-quality, versatile (default) | | `mystic` | Freepik's exclusive photorealistic workflow | | `flux-kontext-pro` | Instruction-based image editing (img2img) | | `flux-2-turbo` | Fast generation | | `flux-pro-1.1` | Flux Pro v1.1 | | `seedream-v4` | Quality generation with editing support | | `seedream-v4-5` | Seedream v4.5 (faster) | | `ideogram-v2` | Ideogram v2 | **Examples:** ```bash freepik generate-image "a cat on the moon, oil painting style" freepik generate-image "cyberpunk city at night" --model mystic --aspect-ratio 16:9 freepik generate-image "make the sky orange at sunset" --model flux-kontext-pro --input-image photo.jpg freepik generate-image "portrait of a wizard" --seed 42 --output wizard.jpg freepik generate-image "vast ocean panorama" --model flux-2-pro --no-wait ``` --- ### `generate-video` Animate a source image into a short video clip. ```bash freepik generate-video [OPTIONS] ``` | Option | Short | Default | Description | |--------|-------|---------|-------------| | `--model` | `-m` | `kling-o1-pro` | Video AI model | | `--prompt` | `-p` | — | Motion/style guidance | | `--duration` | `-d` | `5` | Duration in seconds (`5` or `10`) | | `--aspect-ratio` | `-a` | `16:9` | `16:9` \| `9:16` \| `1:1` | | `--seed` | | — | Seed for reproducibility | | `--output` | `-o` | auto | Output `.mp4` path | | `--wait / --no-wait` | | `--wait` | | | `--api-key` | | `$FREEPIK_API_KEY` | | **Available models:** | Model | Description | |-------|-------------| | `kling-o1-pro` | Best quality, first/last frame interpolation (default) | | `kling-o1-std` | Standard quality Kling O1 | | `kling-elements-pro` | Kling Elements Pro | | `kling-elements-std` | Kling Elements Standard | | `minimax-hailuo` | Minimax Hailuo 1080p | | `wan-2.5` | WAN 2.5 | | `runway-gen4` | Runway Gen4 | **Examples:** ```bash freepik generate-video photo.jpg --prompt "gentle ocean waves lapping at the shore" freepik generate-video portrait.png --model minimax-hailuo --duration 10 --aspect-ratio 9:16 freepik generate-video landscape.jpg --model kling-o1-pro --output timelapse.mp4 ``` --- ### `upscale-image` Upscale and enhance an image using AI. ```bash freepik upscale-image [OPTIONS] ``` | Option | Short | Default | Description | |--------|-------|---------|-------------| | `--mode` | | `precision-v2` | Upscaling mode (see below) | | `--scale` | | `2x` | Scale factor: `2x` or `4x` | | `--creativity` | | — | Creative level 0–10 (creative mode only) | | `--prompt` | `-p` | — | Enhancement guidance (creative mode only) | | `--seed` | | — | Seed for reproducibility | | `--output` | `-o` | auto | Output file path | | `--wait / --no-wait` | | `--wait` | | | `--api-key` | | `$FREEPIK_API_KEY` | | **Modes:** | Mode | Description | |------|-------------| | `precision-v2` | Faithful, detail-preserving upscale (recommended) | | `precision` | Faithful upscaling | | `creative` | AI-enhanced creative reinterpretation | **Examples:** ```bash freepik upscale-image photo.jpg --scale 4x freepik upscale-image photo.jpg --mode precision-v2 --scale 2x --output photo_hd.jpg freepik upscale-image portrait.jpg --mode creative --creativity 6 --prompt "sharp cinematic texture" ``` --- ### `upscale-video` Upscale a video to higher resolution using AI. ```bash freepik upscale-video