From midjourney-api-dev
Guides image reference usage (image prompt, sref, oref) — use when the user mentions 이미지 참조, sref, oref, style reference, object reference, character reference, 이미지 프롬프트, iw, sw, ow, or image upload
How this skill is triggered — by the user, by Claude, or both
Slash command
/midjourney-api-dev:midjourney-image-refThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Three reference types share the same upload flow but serve different purposes.
Three reference types share the same upload flow but serve different purposes.
| Type | Param | Weight | Weight Range | Default | Supports |
|---|---|---|---|---|---|
| Image prompt | image= | iw | 0.0–3.0 | 1.0 | URL, file |
| Style reference | sref= | sw | 0–1000 | 100 | URL, file, code |
| Object reference | oref= | ow | 1–1000 | 100 | URL, file only |
Key constraint: oref accepts only image URLs/files — style codes are not supported.
sref accepts URLs, local files, and style codes (short strings like "abc123").
# URL
job = client.imagine("portrait", image="https://example.com/face.png")
# Local file (auto-uploaded to CDN)
job = client.imagine("portrait", image="./face.png")
# With weight
job = client.imagine("portrait", image="./face.png", iw=2.0)
# Style code
job = client.imagine("landscape", sref="abc123")
# URL
job = client.imagine("landscape", sref="https://example.com/style.png")
# Local file
job = client.imagine("landscape", sref="./style.png")
# With weight
job = client.imagine("landscape", sref="./style.png", sw=500)
# URL only (codes not supported)
job = client.imagine("character in forest", oref="https://example.com/char.png")
# Local file
job = client.imagine("character in forest", oref="./character.png")
# With weight
job = client.imagine("character in forest", oref="./character.png", ow=300)
When a parameter value is a local file path (os.path.exists() returns True):
client._upload_if_local(value) is calledapi.upload_image(file_path) → POST /api/storage-upload-filehttps://cdn.midjourney.com/u/{bucketPathname}See references/upload-flow.md for upload API details.
For direct control, upload manually and construct typed parameters:
from midjourney_api.api import MidjourneyAPI
from midjourney_api.auth import MidjourneyAuth
from midjourney_api.params.types import StyleRef, StyleWeight, OmniRef, OmniWeight
from midjourney_api.params.v7 import V7Params
auth = MidjourneyAuth()
api = MidjourneyAPI(auth)
# Upload image manually
cdn_url = api.upload_image("./style.png")
# Build params with typed references
params = V7Params(
prompt="cyberpunk city",
sref=StyleRef(cdn_url),
sw=StyleWeight(500),
)
params.validate()
job = api.submit_job(params, mode="fast", metadata={"imageReferences": 1})
sw requires sref to be set → ValidationError("sw requires sref to be set")ow requires oref to be set → ValidationError("ow requires oref to be set")niji is incompatible with oref → ValidationError("oref not compatible with niji")Image prompt is prepended to the text prompt:
"https://cdn.midjourney.com/u/.../ref.png cyberpunk city --v 7 --ar 16:9"
Style and object references are appended as flags:
"cyberpunk city --v 7 --sref https://cdn.../style.png --sw 100 --oref https://cdn.../char.png --ow 100"
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.