From midjourney-api-dev
Guides image download and job management — use when the user mentions 다운로드, download, 이미지 저장, list_jobs, Job 모델, Job dataclass, UserSettings, or saving midjourney images
How this skill is triggered — by the user, by Claude, or both
Slash command
/midjourney-api-dev:midjourney-downloadThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
```python
def download_images(
self,
job: Job,
output_dir: str = "./images",
size: int = 640,
indices: list[int] | None = None,
) -> list[Path]
| Param | Type | Default | Description |
|---|---|---|---|
job | Job | — | Completed job to download |
output_dir | str | "./images" | Output directory (created if needed) |
size | int | 640 | CDN image size (e.g., 640, 1024) |
indices | list[int] | None | None | Specific indices to download (None = all) |
with MidjourneyClient() as client:
job = client.imagine("landscape")
# Download all 4 grid images
paths = client.download_images(job, "./output")
# → ["./output/{job_id}_0.webp", ..., "./output/{job_id}_3.webp"]
# Download specific indices
paths = client.download_images(job, "./output", indices=[0, 2])
# Higher resolution
paths = client.download_images(job, "./output", size=1024)
# Upscaled job (1 image)
upscaled = client.upscale(job.id, index=0)
paths = client.download_images(upscaled, "./output")
# → ["./output/{job_id}_0.webp"]
{output_dir}/{job_id}_{index}.webp
https://cdn.midjourney.com/{job_id}/0_{index}_{size}_N.webp?method=shortest
job.image_urls length determines how many to downloadimage_urls has 4 entries)image_urls has 1 entry)image_urls is empty, defaults to 4디스크 I/O 없이 raw bytes로 직접 받아 메모리에서 처리할 때 사용.
def download_images_bytes(
self,
job: Job,
size: int = 640,
indices: list[int] | None = None,
) -> list[bytes]
from io import BytesIO
from PIL import Image
with MidjourneyClient() as client:
job = client.imagine("landscape")
# Raw bytes로 받기
data_list = client.download_images_bytes(job, size=1024)
# PIL로 직접 디코딩 (임시 파일 불필요)
images = [Image.open(BytesIO(data)).convert("RGB") for data in data_list]
download_images()와 동일한 CDN URL/인덱스 로직을 사용하지만, 파일을 저장하지 않고 list[bytes]를 반환합니다.
For full video download details, see the midjourney-animate skill. Quick reference:
# Download video to disk
paths = client.download_video(video_job, "./videos", size=1080)
# -> ["./videos/{job_id}_0_1080.mp4"]
# Download video as bytes
data = client.download_video_bytes(video_job)
jobs = client.list_jobs(limit=50) # default: 50
for job in jobs:
print(f"{job.id}: {job.prompt} [{job.status}]")
def list_jobs(self, limit: int = 50) -> list[Job]
Module: midjourney_api.models
@dataclass
class Job:
id: str # job UUID
prompt: str # full prompt with flags
status: str = "pending" # pending, running, completed, failed
progress: int = 0 # 0–100
image_urls: list[str] = field(...) # CDN URLs (populated on completion)
user_id: str = ""
enqueue_time: str | None = None
parent_id: str | None = None # parent job ID (for vary/upscale/pan)
event_type: str | None = None # event type (contains "video" for video jobs)
| Property | Type | Description |
|---|---|---|
job.is_completed | bool | status == "completed" |
job.is_failed | bool | status == "failed" |
job.is_video | bool | True if event_type contains "video" |
job.cdn_url(index=0, size=640) -> str
# -> "https://cdn.midjourney.com/{id}/0_{index}_{size}_N.webp?method=shortest"
job.video_url(index=0, size=None) -> str
# -> "cdn.midjourney.com/video/{id}/{index}.mp4"
job.gif_url(index=0) -> str
# -> "cdn.midjourney.com/video/{id}/{index}_N.gif"
@dataclass
class UserSettings:
user_id: str
subscription_type: str = "" # e.g., "standard", "pro"
fast_time_remaining: float = 0.0 # remaining fast GPU seconds
relax_enabled: bool = False
stealth_enabled: bool = False
raw_data: dict = field(...) # full API response
settings = client.get_settings()
print(settings.subscription_type)
print(settings.fast_time_remaining)
queue = client.get_queue() # raw dict from /api/user-queue
npx claudepluginhub juyeongyi/jylee_claude_marketplace --plugin midjourney-api-devCreates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.