CLI tool for Midjourney AI Image & Video Generation via AceDataCloud API
Project description
Midjourney CLI
A command-line tool for AI image and video generation using Midjourney through the AceDataCloud API.
Generate AI images, edit photos, create videos, and manage tasks directly from your terminal — no MCP client required.
Features
- Image Generation — Generate from prompts, transform (upscale/variation/zoom/pan), blend images
- Image Editing — Edit with prompts and masks, describe images (reverse prompt), translate prompts
- Video Generation — Generate video from text + reference image, extend existing videos
- Task Management — Query tasks, batch query, wait with polling
- Rich Output — Beautiful terminal tables and panels via Rich
- JSON Mode — Machine-readable output with
--jsonfor piping - Multiple Modes — fast, turbo, relax generation modes
- V8 Support — HD mode, ultra quality, style references
Quick Start
1. Get API Token
Get your API token from AceDataCloud Platform:
- Sign up or log in
- Navigate to Midjourney API
- Click "Acquire" to get your token
2. Install
# Install with pip
pip install midjourney-pro-cli
# Or with uv (recommended)
uv pip install midjourney-pro-cli
# Or from source
git clone https://github.com/AceDataCloud/MidjourneyCli.git
cd MidjourneyCli
pip install -e .
3. Configure
# Set your API token
export ACEDATACLOUD_API_TOKEN=your_token_here
# Or use .env file
cp .env.example .env
# Edit .env with your token
4. Use
# Generate an image
midjourney imagine "A majestic lion at sunset, cinematic lighting"
# Generate with V8 HD mode
midjourney imagine "Cyberpunk city" --version 8 --hd --mode turbo
# Upscale a specific image from the grid
midjourney transform <image_id> upscale1
# Edit an existing image
midjourney edit https://example.com/photo.jpg "Add a sunset background"
# Describe an image (reverse prompt)
midjourney describe https://example.com/photo.jpg
# Generate video
midjourney video "A cat walking" --image-url https://example.com/cat.jpg
# Check task status
midjourney task <task_id>
# Wait for completion
midjourney wait <task_id> --interval 5
Commands
Image Generation
| Command | Description |
|---|---|
midjourney imagine <prompt> |
Generate a 2x2 grid of images from text |
midjourney transform <image_id> <action> |
Upscale, vary, zoom, or pan an image |
midjourney blend <url1> <url2> [...] |
Blend 2-5 images together |
Image Editing
| Command | Description |
|---|---|
midjourney edit <image_url> <prompt> |
Edit an image with a text prompt |
midjourney describe <image_url> |
Get 4 AI descriptions of an image |
midjourney translate <content> |
Translate Chinese text to English prompts |
Video Generation
| Command | Description |
|---|---|
midjourney video <prompt> --image-url <url> |
Generate video from text + image |
midjourney extend-video <video_id> <prompt> |
Extend an existing video |
Task Management
| Command | Description |
|---|---|
midjourney task <task_id> |
Query a single task status |
midjourney tasks <id1> <id2> [...] |
Query multiple tasks at once |
midjourney wait <task_id> |
Wait for task completion with polling |
midjourney seed <image_id> |
Get the seed value of a generated image |
Utilities
| Command | Description |
|---|---|
midjourney modes |
List available generation modes |
midjourney versions |
List available Midjourney versions |
midjourney actions |
List available transform actions |
midjourney config |
Show current configuration |
Global Options
--token TEXT API token (or set ACEDATACLOUD_API_TOKEN env var)
--version Show version
--help Show help message
Most commands support:
--json Output raw JSON (for piping/scripting)
--mode TEXT Generation mode: fast (default), turbo, relax
Transform Actions
After generating a 2x2 grid with imagine:
| Action | Description |
|---|---|
upscale1-4 |
Upscale one of the 4 grid images |
upscale_2x / upscale_4x |
Further upscale an upscaled image |
variation1-4 |
Create variations of one grid image |
variation_subtle / variation_strong |
Create subtle/strong variations |
variation_region |
Edit specific region with mask |
reroll |
Regenerate all 4 images |
zoom_out_2x / zoom_out_1_5x |
Zoom out |
pan_left/right/up/down |
Expand image in a direction |
Scripting & Piping
The --json flag outputs machine-readable JSON suitable for piping:
# Generate and extract task ID
TASK_ID=$(midjourney imagine "sunset" --json | jq -r '.task_id')
# Wait for completion and get image URL
midjourney wait $TASK_ID --json | jq -r '.image_url'
# Batch generate from a file of prompts
while IFS= read -r prompt; do
midjourney imagine "$prompt" --json >> results.jsonl
done < prompts.txt
Available Versions
| Version | Notes |
|---|---|
5.2 |
Stable, well-tested |
6 |
Improved prompt understanding |
6.1 |
Enhanced detail and coherence |
7 |
Better composition and realism |
8 |
Latest V8 Alpha — HD and ultra quality support |
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
ACEDATACLOUD_API_TOKEN |
API token from AceDataCloud | Required |
ACEDATACLOUD_API_BASE_URL |
API base URL | https://api.acedata.cloud |
MIDJOURNEY_REQUEST_TIMEOUT |
Timeout in seconds | 1800 |
Development
Setup Development Environment
# Clone repository
git clone https://github.com/AceDataCloud/MidjourneyCli.git
cd MidjourneyCli
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
# Install with dev dependencies
pip install -e ".[dev,test]"
Run Tests
# Run unit tests
pytest
# Run with coverage
pytest --cov=midjourney_cli
# Run integration tests (requires API token)
pytest tests/test_integration.py -m integration
Code Quality
# Format code
ruff format .
# Lint code
ruff check .
# Type check
mypy midjourney_cli
Build & Publish
# Install build dependencies
pip install -e ".[release]"
# Build package
python -m build
# Upload to PyPI
twine upload dist/*
Docker
# Pull the image
docker pull ghcr.io/acedatacloud/midjourney-cli:latest
# Run a command
docker run --rm -e ACEDATACLOUD_API_TOKEN=your_token \
ghcr.io/acedatacloud/midjourney-cli imagine "A happy scene"
# Or use docker-compose
docker compose run --rm midjourney-cli imagine "A happy scene"
Project Structure
MidjourneyCli/
├── midjourney_cli/ # Main package
│ ├── __init__.py
│ ├── __main__.py # python -m midjourney_cli entry point
│ ├── main.py # CLI entry point
│ ├── core/ # Core modules
│ │ ├── client.py # HTTP client for Midjourney API
│ │ ├── config.py # Configuration management
│ │ ├── exceptions.py # Custom exceptions
│ │ └── output.py # Rich terminal formatting
│ └── commands/ # CLI command groups
│ ├── imagine.py # Image generation (imagine, transform, blend)
│ ├── edit.py # Edit, describe, translate commands
│ ├── video.py # Video generation commands
│ ├── task.py # Task management commands
│ └── info.py # Info & utility commands
├── tests/ # Test suite
├── Dockerfile # Container image
├── .env.example # Environment template
├── pyproject.toml # Project configuration
└── README.md
Midjourney CLI vs MCP Midjourney
| Feature | Midjourney CLI | MCP Midjourney |
|---|---|---|
| Interface | Terminal commands | MCP protocol |
| Usage | Direct shell, scripts, CI/CD | Claude, VS Code, MCP clients |
| Output | Rich tables / JSON | Structured MCP responses |
| Automation | Shell scripts, piping | AI agent workflows |
| Install | pip install midjourney-pro-cli |
pip install mcp-midjourney |
Both tools use the same AceDataCloud API and share the same API token.
API Reference
This tool wraps the AceDataCloud Midjourney API:
- Midjourney Imagine API — Image generation
- Midjourney Edits API — Image editing
- Midjourney Videos API — Video generation
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing) - Open a Pull Request
License
MIT License - see LICENSE for details.
Links
- AceDataCloud Platform
- MCP Midjourney — MCP server version
- Midjourney Official
Made with ❤️ by AceDataCloud
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file midjourney_pro_cli-2026.4.5.2.tar.gz.
File metadata
- Download URL: midjourney_pro_cli-2026.4.5.2.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c09cbf366739a682e8365006f6aee91050a84c574ba8e94ad195fcfe4630d3ca
|
|
| MD5 |
31573b3799b7bf20fc76d23dd046541d
|
|
| BLAKE2b-256 |
609b4bc5dc7bf332de2754887e5b24ecd42bdbf54752a16b9edf5b9b6d59ce11
|
File details
Details for the file midjourney_pro_cli-2026.4.5.2-py3-none-any.whl.
File metadata
- Download URL: midjourney_pro_cli-2026.4.5.2-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
516f425829eafb04119ff92c50d9f82b4ed227873058db6742b8fcfe02a0ace3
|
|
| MD5 |
ae212f001f25bb01a4b958bfc7c8bbab
|
|
| BLAKE2b-256 |
1038f8282ad0eda618fc6c3b8f687439b5a3b4be8fc41bdabdf9fb029550e68e
|