From e6bf85ca8aba803c4f332af703c19f85c83f2c2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 8 Apr 2026 10:59:29 +0200 Subject: [PATCH] docs: add comprehensive README and .claude to .gitignore Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 1 + README.md | 477 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 453 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index dcf9030..1cf31ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .venv/ +.claude/ __pycache__/ *.pyc *.pyo diff --git a/README.md b/README.md index 5634724..af923f0 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,479 @@ # Freepik AI CLI -A sophisticated, beautiful Python CLI for generating and manipulating images and video with the [Freepik API](https://docs.freepik.com/introduction). +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 +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 -export FREEPIK_API_KEY=your_api_key_here - # Generate an image -freepik generate-image "a majestic mountain at sunset" --model flux-2-pro +freepik generate-image "a misty forest at dawn, cinematic lighting" -# Generate a video from an image -freepik generate-video photo.jpg --prompt "gentle ocean waves" --model kling-o1-pro +# Animate an image into a video +freepik generate-video photo.jpg --prompt "gentle camera drift" --duration 5 -# Upscale an image +# Upscale an image 4x freepik upscale-image photo.jpg --mode precision-v2 --scale 4x # Upscale a video -freepik upscale-video clip.mp4 --mode standard +freepik upscale-video clip.mp4 --mode turbo + +# Describe an image (reverse-engineer its prompt) +freepik describe-image painting.jpg ``` ## Commands -| Command | Description | -|---------|-------------| -| `generate-image` | Generate images from text prompts | -| `generate-video` | Animate an image into a video | -| `generate-icon` | Generate icons in various styles | -| `upscale-image` | Upscale and enhance images | -| `upscale-video` | Upscale video to higher resolution | -| `expand-image` | Outpaint / expand image borders | -| `relight` | Relight an image (Premium) | -| `style-transfer` | Apply artistic styles (Premium) | -| `describe-image` | Reverse-engineer an image into a prompt | -| `config` | Manage CLI configuration | +### `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