Upload an image
upload_imageUpload a local image or base64 to 2DAI cloud drive for use as a reference in AI generation. Handles moderation and size limits.
Instructions
Upload a local image (or base64 bytes) to the 2DAI cloud drive so it can be used as a reference for generation ("use THIS image"). Free, but the file goes through the platform's moderation pass — NSFW beyond the account's ceiling is rejected. Max 10 MB; jpeg/png/webp. Paths must stay inside the working directory unless the server was started with TWODAI_ALLOW_ANY_PATH=1.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to the image file, relative to the working directory. | |
| base64 | No | Raw base64 image bytes — alternative to path. | |
| filename | No | Filename to store (defaults to the source name). | |
| contentType | No | MIME type when sending base64 (e.g. image/png). | |
| targetFolderId | No | File the upload directly into this folder (must be a folder you can write to); omit to land at the drive root. | |
| erasedFromCreationId | No | Record this upload as an ERASE (alpha) edit of an existing creation you own. Mutually exclusive with croppedFromCreationId. | |
| croppedFromCreationId | No | Record this upload as a CROP edit of an existing creation you own — description and moderation verdict are inherited. |