refactor: rename project from Freepik to Magnific

Rename all identifiers, strings, file names, env vars, CLI entry point,
ASCII banner, and API endpoint to reflect the company rebrand.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-16 13:06:16 +02:00
parent e013db9065
commit 941fd14ccf
24 changed files with 294 additions and 294 deletions
+88 -88
View File
@@ -1,15 +1,15 @@
# Freepik AI CLI
# Magnific 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.
A sophisticated, beautiful command-line interface for the [Magnific AI API](https://magnific.ai) — generate images, animate videos, upscale media, and more, all from your terminal.
```
██████╗██████╗ ███████╗███████╗██████╗ ██╗██╗ ██╗
██╔════╝██╔══██╗██╔════╝██╔════╝██╔══████║██║ ██╔╝
█████╗ ██████╔╝█████ █████╗ ██████╔╝██║█████╔╝
██╔══╝ ██╔══████╔══╝ ██╔══╝ ██╔══╝ ██║██╔═██╗
██║ ██║ ██║███████╗█████████║ ██║████╗
╚═╝ ╚═╝ ╚═╝╚═════╝╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝
AI Media Generation CLI • v0.1.0
███╗ ███╗ █████╗ ██████╗ ███████╗███████╗██╗ ██████╗
████╗ ████║██╔══██╗██╔════╝ ████╗ ████║██╔════╝██║██╔════
██████╔██║█████████ ███╗██╔██╗ █████████╗ ████
██║╚██╔╝██║██╔══████║ ██║██║╚██╗██║██║██╔══╝ ██║██
██║ ╚═╝ ██║██║ ██║██████╔╝██║ ╚████████║ ██║██████╗
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝ ╚═════╝
AI Media Generation CLI • v0.1.0
```
## Features
@@ -18,20 +18,20 @@ A sophisticated, beautiful command-line interface for the [Freepik AI API](https
- **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
- **Zero config required** — just set `MAGNIFIC_API_KEY` and go
## Installation
### Prerequisites
- Python 3.11+
- A [Freepik API key](https://www.freepik.com/api) (free tier includes $5 credit)
- A [Magnific API key](https://magnific.ai) (free tier includes $5 credit)
### Setup
```bash
git clone <repo>
cd freepik
cd magnific
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
@@ -42,7 +42,7 @@ pip install -e .
### API Key
```bash
export FREEPIK_API_KEY=your_api_key_here
export MAGNIFIC_API_KEY=your_api_key_here
```
Or add it to a `.env` file in the project root (see `.env.example`).
@@ -51,19 +51,19 @@ Or add it to a `.env` file in the project root (see `.env.example`).
```bash
# Generate an image
freepik generate-image "a misty forest at dawn, cinematic lighting"
magnific 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
magnific generate-video photo.jpg --prompt "gentle camera drift" --duration 5
# Upscale an image 4x
freepik upscale-image photo.jpg --mode precision-v2 --scale 4x
magnific upscale-image photo.jpg --mode precision-v2 --scale 4x
# Upscale a video
freepik upscale-video clip.mp4 --mode turbo
magnific upscale-video clip.mp4 --mode turbo
# Describe an image (reverse-engineer its prompt)
freepik describe-image painting.jpg
magnific describe-image painting.jpg
```
## Commands
@@ -73,7 +73,7 @@ freepik describe-image painting.jpg
Generate an image from a text prompt.
```bash
freepik generate-image <prompt> [OPTIONS]
magnific generate-image <prompt> [OPTIONS]
```
| Option | Short | Default | Description |
@@ -85,14 +85,14 @@ freepik generate-image <prompt> [OPTIONS]
| `--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 |
| `--api-key` | | `$MAGNIFIC_API_KEY` | API key override |
**Available models:**
| Model | Description |
|-------|-------------|
| `flux-2-pro` | High-quality, versatile (default) |
| `mystic` | Freepik's exclusive photorealistic workflow |
| `mystic` | Magnific'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 |
@@ -103,11 +103,11 @@ freepik generate-image <prompt> [OPTIONS]
**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
magnific generate-image "a cat on the moon, oil painting style"
magnific generate-image "cyberpunk city at night" --model mystic --aspect-ratio 16:9
magnific generate-image "make the sky orange at sunset" --model flux-kontext-pro --input-image photo.jpg
magnific generate-image "portrait of a wizard" --seed 42 --output wizard.jpg
magnific generate-image "vast ocean panorama" --model flux-2-pro --no-wait
```
---
@@ -117,7 +117,7 @@ freepik generate-image "vast ocean panorama" --model flux-2-pro --no-wait
Animate a source image into a short video clip.
```bash
freepik generate-video <image> [OPTIONS]
magnific generate-video <image> [OPTIONS]
```
| Option | Short | Default | Description |
@@ -129,7 +129,7 @@ freepik generate-video <image> [OPTIONS]
| `--seed` | | — | Seed for reproducibility |
| `--output` | `-o` | auto | Output `.mp4` path |
| `--wait / --no-wait` | | `--wait` | |
| `--api-key` | | `$FREEPIK_API_KEY` | |
| `--api-key` | | `$MAGNIFIC_API_KEY` | |
**Available models:**
@@ -146,9 +146,9 @@ freepik generate-video <image> [OPTIONS]
**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
magnific generate-video photo.jpg --prompt "gentle ocean waves lapping at the shore"
magnific generate-video portrait.png --model minimax-hailuo --duration 10 --aspect-ratio 9:16
magnific generate-video landscape.jpg --model kling-o1-pro --output timelapse.mp4
```
---
@@ -158,7 +158,7 @@ freepik generate-video landscape.jpg --model kling-o1-pro --output timelapse.mp4
Upscale and enhance an image using AI.
```bash
freepik upscale-image <image> [OPTIONS]
magnific upscale-image <image> [OPTIONS]
```
| Option | Short | Default | Description |
@@ -170,7 +170,7 @@ freepik upscale-image <image> [OPTIONS]
| `--seed` | | — | Seed for reproducibility |
| `--output` | `-o` | auto | Output file path |
| `--wait / --no-wait` | | `--wait` | |
| `--api-key` | | `$FREEPIK_API_KEY` | |
| `--api-key` | | `$MAGNIFIC_API_KEY` | |
**Modes:**
@@ -183,9 +183,9 @@ freepik upscale-image <image> [OPTIONS]
**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"
magnific upscale-image photo.jpg --scale 4x
magnific upscale-image photo.jpg --mode precision-v2 --scale 2x --output photo_hd.jpg
magnific upscale-image portrait.jpg --mode creative --creativity 6 --prompt "sharp cinematic texture"
```
---
@@ -195,7 +195,7 @@ freepik upscale-image portrait.jpg --mode creative --creativity 6 --prompt "shar
Upscale a video to higher resolution using AI.
```bash
freepik upscale-video <video> [OPTIONS]
magnific upscale-video <video> [OPTIONS]
```
| Option | Short | Default | Description |
@@ -203,13 +203,13 @@ freepik upscale-video <video> [OPTIONS]
| `--mode` | | `standard` | `standard` \| `turbo` (faster) |
| `--output` | `-o` | auto | Output `.mp4` path |
| `--wait / --no-wait` | | `--wait` | |
| `--api-key` | | `$FREEPIK_API_KEY` | |
| `--api-key` | | `$MAGNIFIC_API_KEY` | |
**Examples:**
```bash
freepik upscale-video clip.mp4
freepik upscale-video clip.mp4 --mode turbo --output clip_4k.mp4
magnific upscale-video clip.mp4
magnific upscale-video clip.mp4 --mode turbo --output clip_4k.mp4
```
---
@@ -219,7 +219,7 @@ freepik upscale-video clip.mp4 --mode turbo --output clip_4k.mp4
Generate an icon from a text prompt in various styles.
```bash
freepik generate-icon <prompt> [OPTIONS]
magnific generate-icon <prompt> [OPTIONS]
```
| Option | Short | Default | Description |
@@ -234,9 +234,9 @@ freepik generate-icon <prompt> [OPTIONS]
**Examples:**
```bash
freepik generate-icon "shopping cart" --style solid --format svg
freepik generate-icon "rocket ship" --style color --format png
freepik generate-icon "leaf" --style outline --format svg --output leaf.svg
magnific generate-icon "shopping cart" --style solid --format svg
magnific generate-icon "rocket ship" --style color --format png
magnific generate-icon "leaf" --style outline --format svg --output leaf.svg
```
---
@@ -246,7 +246,7 @@ freepik generate-icon "leaf" --style outline --format svg --output leaf.svg
Expand an image by generating new content around its edges (outpainting).
```bash
freepik expand-image <image> [OPTIONS]
magnific expand-image <image> [OPTIONS]
```
| Option | Default | Description |
@@ -263,9 +263,9 @@ freepik expand-image <image> [OPTIONS]
**Examples:**
```bash
freepik expand-image photo.jpg --left 512 --right 512 --prompt "lush green forest"
freepik expand-image banner.png --bottom 256 --model seedream-v4-5
freepik expand-image portrait.jpg --top 300 --bottom 300 --prompt "studio backdrop"
magnific expand-image photo.jpg --left 512 --right 512 --prompt "lush green forest"
magnific expand-image banner.png --bottom 256 --model seedream-v4-5
magnific expand-image portrait.jpg --top 300 --bottom 300 --prompt "studio backdrop"
```
---
@@ -275,7 +275,7 @@ freepik expand-image portrait.jpg --top 300 --bottom 300 --prompt "studio backdr
Analyze an image and generate a descriptive text prompt for it — useful for reverse-engineering AI images or building prompt libraries.
```bash
freepik describe-image <image> [OPTIONS]
magnific describe-image <image> [OPTIONS]
```
| Option | Short | Description |
@@ -287,8 +287,8 @@ freepik describe-image <image> [OPTIONS]
**Examples:**
```bash
freepik describe-image painting.jpg
freepik describe-image scene.png --output scene_prompt.txt
magnific describe-image painting.jpg
magnific describe-image scene.png --output scene_prompt.txt
```
---
@@ -298,7 +298,7 @@ freepik describe-image scene.png --output scene_prompt.txt
Relight an image using AI-controlled lighting.
```bash
freepik relight <image> [OPTIONS]
magnific relight <image> [OPTIONS]
```
| Option | Short | Description |
@@ -310,8 +310,8 @@ freepik relight <image> [OPTIONS]
**Examples:**
```bash
freepik relight portrait.jpg --prompt "warm golden hour sunlight from the left"
freepik relight product.png --prompt "soft studio lighting, white background"
magnific relight portrait.jpg --prompt "warm golden hour sunlight from the left"
magnific relight product.png --prompt "soft studio lighting, white background"
```
---
@@ -321,7 +321,7 @@ freepik relight product.png --prompt "soft studio lighting, white background"
Apply the artistic style from one image onto the content of another.
```bash
freepik style-transfer <content-image> <style-image> [OPTIONS]
magnific style-transfer <content-image> <style-image> [OPTIONS]
```
| Option | Description |
@@ -332,23 +332,23 @@ freepik style-transfer <content-image> <style-image> [OPTIONS]
**Examples:**
```bash
freepik style-transfer photo.jpg van_gogh.jpg
freepik style-transfer portrait.png impressionist.jpg --strength 0.75 --output styled.jpg
magnific style-transfer photo.jpg van_gogh.jpg
magnific style-transfer portrait.png impressionist.jpg --strength 0.75 --output styled.jpg
```
---
### `config`
Manage CLI configuration stored at `~/.config/freepik-cli/config.toml`.
Manage CLI configuration stored at `~/.config/magnific-cli/config.toml`.
```bash
freepik config show # Display all settings (as a table)
freepik config show --toml # Display as highlighted TOML
freepik config get <key> # Print a single value
freepik config set <key> <value> # Update a setting
freepik config reset # Reset to defaults
freepik config path # Print the config file path
magnific config show # Display all settings (as a table)
magnific config show --toml # Display as highlighted TOML
magnific config get <key> # Print a single value
magnific config set <key> <value> # Update a setting
magnific config reset # Reset to defaults
magnific config path # Print the config file path
```
**Configurable keys:**
@@ -359,20 +359,20 @@ freepik config path # Print the config file path
| `default_video_model` | `kling-o1-pro` | Default model for `generate-video` |
| `default_upscale_mode` | `precision-v2` | Default mode for `upscale-image` |
| `default_output_dir` | `.` | Directory for auto-generated output files |
| `base_url` | `https://api.freepik.com` | API base URL |
| `base_url` | `https://api.magnific.ai` | API base URL |
| `poll_timeout` | `600` | Max seconds to wait for task completion |
| `poll_max_interval` | `15` | Max seconds between polling attempts |
| `show_banner` | `true` | Show the ASCII art banner |
> **Note:** The API key is never saved to the config file. Use `FREEPIK_API_KEY` or `--api-key`.
> **Note:** The API key is never saved to the config file. Use `MAGNIFIC_API_KEY` or `--api-key`.
**Examples:**
```bash
freepik config set default_image_model mystic
freepik config set default_output_dir ~/Pictures/freepik
freepik config set show_banner false
freepik config set poll_timeout 300
magnific config set default_image_model mystic
magnific config set default_output_dir ~/Pictures/magnific
magnific config set show_banner false
magnific config set poll_timeout 300
```
## Configuration
@@ -380,36 +380,36 @@ freepik config set poll_timeout 300
Settings are resolved in this priority order (highest wins):
1. `--api-key` / `--model` / etc. command-line flags
2. `FREEPIK_*` environment variables (e.g. `FREEPIK_API_KEY`)
3. `~/.config/freepik-cli/config.toml`
2. `MAGNIFIC_*` environment variables (e.g. `MAGNIFIC_API_KEY`)
3. `~/.config/magnific-cli/config.toml`
4. Built-in defaults
### Environment Variables
| Variable | Description |
|----------|-------------|
| `FREEPIK_API_KEY` | Your Freepik API key **(required)** |
| `FREEPIK_BASE_URL` | API base URL override |
| `FREEPIK_DEFAULT_IMAGE_MODEL` | Default image model |
| `FREEPIK_DEFAULT_VIDEO_MODEL` | Default video model |
| `FREEPIK_DEFAULT_OUTPUT_DIR` | Default output directory |
| `FREEPIK_POLL_TIMEOUT` | Task polling timeout in seconds |
| `FREEPIK_SHOW_BANNER` | Show/hide the ASCII banner (`true`/`false`) |
| `MAGNIFIC_API_KEY` | Your Magnific API key **(required)** |
| `MAGNIFIC_BASE_URL` | API base URL override |
| `MAGNIFIC_DEFAULT_IMAGE_MODEL` | Default image model |
| `MAGNIFIC_DEFAULT_VIDEO_MODEL` | Default video model |
| `MAGNIFIC_DEFAULT_OUTPUT_DIR` | Default output directory |
| `MAGNIFIC_POLL_TIMEOUT` | Task polling timeout in seconds |
| `MAGNIFIC_SHOW_BANNER` | Show/hide the ASCII banner (`true`/`false`) |
## Output Files
When no `--output` path is provided, files are saved with an auto-generated name:
```
freepik_image_flux-2-pro_20260408_143022.jpg
freepik_video_kling-o1-pro_20260408_143512.mp4
freepik_upscaled_precision-v2_20260408_144001.jpg
magnific_image_flux-2-pro_20260408_143022.jpg
magnific_video_kling-o1-pro_20260408_143512.mp4
magnific_upscaled_precision-v2_20260408_144001.jpg
```
The default output directory is the current working directory. Change it with:
```bash
freepik config set default_output_dir ~/Pictures/freepik
magnific config set default_output_dir ~/Pictures/magnific
```
## Async Workflows (`--no-wait`)
@@ -418,7 +418,7 @@ Every command supports `--no-wait` to submit a task and return immediately witho
```bash
# Submit and get task ID instantly
freepik generate-image "a nebula" --model mystic --no-wait
magnific generate-image "a nebula" --model mystic --no-wait
# Task Queued
# Task ID: c3f2a1b8-...
@@ -433,7 +433,7 @@ This is useful for batching multiple requests or integrating with scripts.
Install tab-completion for your shell:
```bash
freepik --install-completion # auto-detects your shell
magnific --install-completion # auto-detects your shell
```
Supports bash, zsh, fish, and PowerShell.
@@ -441,10 +441,10 @@ Supports bash, zsh, fish, and PowerShell.
## Project Structure
```
freepik/
magnific/
├── pyproject.toml
├── .env.example
├── freepik_cli/
├── magnific_cli/
│ ├── main.py # CLI entry point
│ ├── api/
│ │ ├── client.py # HTTP client (httpx)
@@ -461,7 +461,7 @@ freepik/
│ │ └── config.py # config management
│ └── utils/
│ ├── console.py # Rich console, theme, display helpers
│ ├── config.py # FreepikConfig (pydantic-settings)
│ ├── config.py # MagnificConfig (pydantic-settings)
│ ├── polling.py # Live polling with Rich
│ └── files.py # Base64 encoding, download, path utils
```