POST /image/upload (or mynth.image.upload()) when you need Mynth-hosted URLs for input images. Pass those URLs — or any public image URL — in inputs on POST /image/generate.
If your images are already publicly reachable over HTTP(S), skip upload and put the URLs in inputs directly. This page is not about delivering generated images to your own storage — that is the optional destination field on generate (see Image Generation Request).
Pricing
Upload is free. Mynth does not charge forPOST /image/upload.
Generation still bills per successful output image. Some models also charge per input image on each successful output (perImage + perInput × inputs.length). Check the model page for perInput pricing.
Pass a public URL (no upload)
The simplest path: put a URL string ininputs.
Upload local files with the SDK
mynth.image.upload() accepts a File / Blob, or an array of them, and returns CDN URLs.
File / Blob values in inputs on generate. The SDK uploads them first, then sends URL inputs to the API:
Upload with REST
Multipart form field name:images (repeated) or images[].
200):
Upload limits
| Constraint | Limit |
|---|---|
| Formats | JPEG, PNG, WebP (image/jpeg, image/png, image/webp) |
| Minimum file size | 1 KB (1024 bytes) |
| Maximum file size | 10 MB per file |
| Maximum files per request | 10 |
| Maximum request body | 100 MB |
400 with code: "VALIDATION_ERROR". Examples:
| Condition | Message |
|---|---|
| No files | At least one image is required |
| More than 10 files | Cannot upload more than 10 images |
| Unsupported MIME type | Only JPEG, PNG, and WEBP images are supported |
| File smaller than 1 KB | Image must be at least 1024 bytes |
| File larger than 10 MB | Image cannot exceed 10485760 bytes |
| Bytes are not a valid image | Invalid image file |
413:
Set input roles (as)
Most models treat inputs as generic references. Some need roles. Set optional as on each structured input:
as | Typical use |
|---|---|
auto | Default when omitted. Let Mynth resolve the role (try-on, source/reference). |
person | Subject for virtual try-on |
garment | Clothing for virtual try-on |
pose | Pose reference (must be explicit when the model supports it) |
source | Primary image to edit (for example Luma UNI) |
reference | Style or composition guidance |
as, Mynth assigns the first undeclared input as source and the rest as reference. For try-on models, undeclared visual roles can be classified by the worker when the model allows it; pose must be declared when you use it.
Per-model input rules
Support is model-specific:- whether inputs are allowed at all
- maximum count (and per-role min/max)
- which roles are accepted
inputs entries. Individual models enforce lower caps (for example 1, 3, 10, or 16). If the model does not support inputs, or the roles/counts do not match its contract, the request fails validation (VALIDATION_ERROR), for example:
How inputs fit generation
- Obtain public HTTP(S) URLs for each input (upload local files, or use URLs you already host).
- Send them in
inputsonPOST /image/generate(URL strings or structured objects). - Mynth validates inputs against the selected model’s contract, then runs image-to-image (or role-based) generation.
- Successful outputs are billed with any model-specific per-input charge.
/inputs/...). It does not start generation, create a task, or reserve balance.