Midjourney Image Generation with Wavespeed API
A Cog-based model that generates images using the Midjourney API via Wavespeed AI.
Overview
This project wraps the Wavespeed AI Midjourney text-to-image API into a deployable Cog model. It provides a clean interface for generating AI images with customizable parameters like aspect ratio, quality, style, and more.
Features
- π¨ Midjourney Integration - Uses Wavespeed AIβs Midjourney API
- βοΈ Flexible Configuration - Customize aspect ratio, quality, chaos, stylize, and other parameters
- π Multiple Model Versions - Support for Midjourney v6, v6.1, and v7
- π Niji Support - Built-in support for Niji anime model variants
- π Async Job Processing - Automatically polls for task completion
Installation
Input Parameters
| Parameter | Type | Description | Default |
|---|---|---|---|
prompt |
str | Text description for image generation | ββ |
aspect_ratio |
str | Image aspect ratio (9:16, 1:1, 16:9, etc.) | β9:16β |
quality |
float | Image quality (0.25, 0.5, 1, 2) | 1 |
version |
str | Midjourney version (β6β, β6.1β, β7β) | β7β |
niji |
str | Niji model version (β0β, β5β, β6β, βcloseβ) | βcloseβ |
seed |
int | Random seed for generation (-1 for random) | -1 |
chaos |
float | Chaos level (0-100) | 0 |
stylize |
float | Stylization level (0-1000) | 0 |
weird |
float | Weirdness factor (0-3000) | 0 |
enable_base64_output |
bool | Enable base64 output | False |
wavespeed_api_token |
str | Wavespeed API token (secret) | ββ |
Configuration
Set your Wavespeed API key either:
- As an input parameter when calling the model
- As the WAVESPEED_API_KEY environment variable
Output
Returns a PNG image file generated by Midjourney based on your input parameters.
Model created