画像生成 APIImage API
Stable Diffusion 3.5 による画像生成・アップスケール・編集・構図コントロール・3D・音声。認証もAPIキーも不要 — JSON を POST するだけ。 Stable Diffusion 3.5 image generation, upscaling, editing, structure control, 3D and audio. No auth, no API key — just POST JSON.
#Generate /generate-img
テキスト、または画像から画像を1枚生成します。日本語プロンプトは DeepL で自動英訳されます。 Generate one image from text or from an image. Japanese prompts are auto-translated via DeepL.
text-to-image(既定)または image-to-image。text-to-image (default) or image-to-image.data: URI。image-to-image のとき必須。Source image URL or data: URI. Required for image-to-image.image-to-image のとき必須。How far to move from the source. Required for image-to-image.1:1。21:9 16:9 3:2 5:4 1:1 4:5 2:3 9:16 9:21。t2i のみ。Default 1:1. 21:9 16:9 3:2 5:4 1:1 4:5 2:3 9:16 9:21. t2i only.sd3.5-large。使えるモデル:
Default sd3.5-large. Available:
ultra · sd3.5-large · sd3.5-large-turbo · sd3.5-medium · sd3.5-flash · core
core は image-to-image 非対応・cfg_scale 無視。sd3.5-large-turbo は negative_prompt 無視。
core: no image-to-image, ignores cfg_scale. sd3.5-large-turbo: ignores negative_prompt.
png。png / jpeg / webp。Default png. png / jpeg / webp.sd3.5-large-turbo では無効。Elements to avoid. Ignored by sd3.5-large-turbo.0(ランダム)。0–4294967294。Default 0 (random). 0–4294967294.photographic, anime, digital-art など。photographic, anime, digital-art, etc.4。Prompt adherence. Default 4.リクエスト
Request
curl -X POST https://api.necco.xyz/generate-img \ -H "Content-Type: application/json" \ -d '{ "prompt": "夕焼けの富士山、写実的Mount Fuji at sunset, photoreal", "model": "sd3.5-large", "aspect_ratio": "16:9", "output_format": "png" }'
curl -X POST https://api.necco.xyz/generate-img \ -d '{ "mode": "image-to-image", "image": "https://example.com/base.png", "strength": 0.6, "prompt": "油絵風oil painting" }'
レスポンス
Response
{ "url": "https://api.necco.xyz/img-public/1788732153475-yKIP8AcI.png" }
/img-public/ に保存され、返却 URL からそのまま取得できます。image-to-image の入力画像は各辺 64px 以上・総画素 ≤ 9,437,184。image を渡すと自動で image-to-image になります(core は非対応)。
Images are stored under /img-public/ and served straight from the returned URL. image-to-image inputs need ≥ 64px per side and ≤ 9,437,184 total pixels. Passing image switches to image-to-image automatically (core does not support it).
#Upscale /upscale
画像を約 4 倍に拡大します。1MP を超える入力はアスペクト比を保って自動縮小されます。 Enlarges an image ~4×. Inputs over 1 MP are auto-downscaled, keeping aspect ratio.
data: URI。各辺 64px 以上。Source image URL or data: URI. ≥ 64px per side.fast(約2cr・promptなし・同期)。conservative(約40cr)/creative(約60cr・非同期)は prompt 必須で 課金済み Stability キーが必要 — 無料キープールでは PREMIUM_MODE_UNAVAILABLE を返します。
Default fast (~2 cr, no prompt, sync). conservative (~40 cr) / creative (~60 cr, async) require a prompt and a funded Stability key — the free key pool returns PREMIUM_MODE_UNAVAILABLE.
conservative / creative では必須、fast では不要。What to preserve / emphasize. Required for conservative / creative, unused by fast.webp。png / jpeg / webp。Default webp. png / jpeg / webp.リクエスト
Request
curl -X POST https://api.necco.xyz/upscale \ -d '{ "image": "https://api.necco.xyz/img-public/1788732153475-yKIP8AcI.png", "mode": "fast" }'
レスポンス
Response
{ "url": "https://api.necco.xyz/img-public/1788740012345-Ab3x_Q9z.webp" }
#Edit /edit
既存画像の部分編集。mode で処理を選びます。すべて無料キープールで動作します。
Targeted edits on an existing image. Pick the operation with mode. All run on the free key pool.
erase · inpaint · outpaint · remove-background · search-and-replace · search-and-recolor · replace-background-and-relight
data: URI。replace-background-and-relight では代わりに subject_image。Target image URL / data: URI. For replace-background-and-relight use subject_image instead.inpaint / search-and-replace / search-and-recolor で必須。生成したい内容。Required for inpaint / search-and-replace / search-and-recolor. What to paint in.search-and-replace で必須 — 置き換える対象を言葉で指定。Required for search-and-replace — describes what to swap out.search-and-recolor で必須 — 色を変える対象。Required for search-and-recolor — what to recolor.outpaint で各方向に拡張するピクセル数。最低1つ必須。Pixels to extend per side for outpaint. At least one required.erase / inpaint の任意マスク画像。省略時はアルファチャンネルを使用。Optional mask image for erase / inpaint. Falls back to the alpha channel.5)。Pixels to grow the mask edge (default 5).replace-background-and-relight: 新しい背景の説明(または background_reference 画像)。どちらか必須。replace-background-and-relight: describe the new background (or pass a background_reference image). One is required.png / webp / jpeg。remove-background は png / webp のみ。png / webp / jpeg. remove-background supports png / webp only.リクエスト
Request
curl -X POST https://api.necco.xyz/edit \ -d '{ "mode": "remove-background", "image": "https://api.necco.xyz/img-public/….png" }'
curl -X POST https://api.necco.xyz/edit \ -d '{ "mode": "search-and-replace", "image": "https://example.com/room.png", "search_prompt": "sofa", "prompt": "革張りのソファa leather sofa" }'
レスポンス
Response
{ "url": "https://api.necco.xyz/img-public/1788860319559-X0vej1B2.png" }
replace-background-and-relight は非同期でサーバー側がポーリングして完了 URL を返します。
Inputs need ≥ 64px per side and ≤ 9,437,184 total pixels (larger inputs auto-downscale). replace-background-and-relight is async — the server polls and returns the finished URL.
#Control /control
参照画像の構図・輪郭・スタイルを保ったまま新しい画像を生成します。すべて無料キープールで動作します。 Generate a new image guided by a reference's structure, edges or style. All run on the free key pool.
structure · sketch · style · style-transfer
structure=構図を保持、sketch=線画から、style=画風を参照して text→image、style-transfer=画像の画風を別画像へ転写。
structure=keep layout, sketch=from line art, style=text→image guided by a style ref, style-transfer=move one image's look onto another.
structure / sketch / style の参照画像。Reference image for structure / sketch / style.style-transfer で必須 — 変換元と画風の2枚。Required for style-transfer — the base and the style source.structure / sketch / style で必須。style-transfer では任意。Required for structure / sketch / style. Optional for style-transfer.structure / sketch: 参照への忠実度(既定 0.7)。structure / sketch: how closely to follow the reference (default 0.7).style: 画風の強さ(既定 0.5)。style: strength of the style match (default 0.5).リクエスト
Request
curl -X POST https://api.necco.xyz/control \ -d '{ "mode": "sketch", "image": "https://example.com/scribble.png", "prompt": "近未来都市、夜、ネオンa futuristic city at night, neon", "control_strength": 0.7 }'
curl -X POST https://api.necco.xyz/control \ -d '{ "mode": "style-transfer", "init_image": "https://example.com/photo.png", "style_image": "https://example.com/vangogh.png" }'
レスポンス
Response
{ "url": "https://api.necco.xyz/img-public/1788860332377-M22PYjHH.png" }
/edit と同じ。
Input size limits are the same as /edit.
#3D /3d
1枚の画像から 3D モデル(.glb)を生成します。背景のない単一の物体を渡してください。無料キープールで動作します。
Turn a single image into a 3D model (.glb). Use one object on a plain background. Runs on the free key pool.
fast(Stable Fast 3D・速い)または spar3d(Stable Point Aware 3D・背面の推定が良い)。
fast (Stable Fast 3D, quick) or spar3d (Stable Point Aware 3D, better back-face reconstruction).
data: URI。各辺 64px 以上・総画素 ≤ 4,194,304・縦横比は 2.5:1 以内。Object image URL / data: URI. ≥ 64px per side, ≤ 4,194,304 total pixels, aspect ratio within 2.5:1.512 / 1024 / 2048(既定 1024)。512 / 1024 / 2048 (default 1024).1.3)。Padding ratio around the object (default 1.3).none / quad / triangle(既定 none)。none / quad / triangle (default none).spar3d のみ: メッシュを vertex / face 数で制限。spar3d only: cap the mesh by vertex / face count.リクエスト
Request
curl -X POST https://api.necco.xyz/3d \ -d '{ "mode": "fast", "image": "https://api.necco.xyz/img-public/….png", "texture_resolution": 1024 }'
レスポンス
Response
{ "url": "https://api.necco.xyz/img-public/1788860342971-ZhWYEUwf.glb" }
SUBJECT_NOT_DETECTED(422)。風景やコラージュではなく、切り抜きやすい物体を渡してください。
Returns SUBJECT_NOT_DETECTED (422) when no clear subject is found. Pass a cut-out-friendly object, not a scene or collage.
#Audio /audio
Stable Audio 2.5 で音楽・効果音を生成します(最長 190 秒)。1回あたり約 19cr と重いため、キープールの消耗が進むと PREMIUM_MODE_UNAVAILABLE になることがあります。
Generate music and sound effects with Stable Audio 2.5 (up to 190 s). Each call costs ~19 cr, so as the key pool drains it can start returning PREMIUM_MODE_UNAVAILABLE.
text-to-audio · audio-to-audio · inpaintaudio-to-audio / inpaint で必須。mp3 / wav の URL または data: URI。Required for audio-to-audio / inpaint. mp3 / wav URL or data: URI.190)。Seconds. 1–190 (default 190).mp3 (既定)(default) / wavリクエスト
Request
curl -X POST https://api.necco.xyz/audio \ -d '{ "mode": "text-to-audio", "prompt": "warm lofi hip hop, vinyl crackle, 90 bpm", "duration": 30, "output_format": "mp3" }'
レスポンス
Response
{ "url": "https://api.necco.xyz/img-public/1788860350016-AnbbxSmn.mp3" }
#エラーレスポンスError responses
失敗時は HTTP 4xx / 5xx と、次の形の JSON を返します。 On failure the API returns HTTP 4xx / 5xx with JSON of this shape.
{ "error": "prompt is empty", "code": "NO_PROMPT", "at": "validate-prompt" }
prompt が空。prompt is empty./edit /control /audio で mode 必須のパラメータ(prompt / search_prompt / outpaint の方向など)が欠けている。A mode-required parameter is missing on /edit /control /audio (prompt, search_prompt, an outpaint direction, …).strength が 0–1 の外。strength outside 0–1.model / mode(有効値はレスポンスの models / modes 参照)。Unknown model / mode (valid values in the response's models / modes).core に image を渡した。image passed to core./3d で画像から被写体を検出できなかった。/3d could not find a subject in the image.conservative(≈40cr)/ creative(≈60cr)upscale。Operation the free key pool (25 cr/key cap) can't afford — conservative (~40 cr) / creative (~60 cr) upscale.upstreamStatus に元コード。Stability-side failure / timeout. Original code in upstreamStatus.