NECCO API
Free · No Auth

画像生成 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.

Base URL https://api.necco.xyz 認証Auth none CORS * Body application/json
エンドポイント
Endpoint

Generate /generate-img

テキスト、または画像から画像を1枚生成します。日本語プロンプトは DeepL で自動英訳されます。 Generate one image from text or from an image. Japanese prompts are auto-translated via DeepL.

POST/generate-img
パラメータ
Parameter
説明
Description
promptstring
生成する画像の説明。日本語可。Description of the image. Japanese allowed.
required
modestring
text-to-image(既定)または image-to-imagetext-to-image (default) or image-to-image.
optional
imagestring
元画像の URL または data: URI。image-to-image のとき必須。Source image URL or data: URI. Required for image-to-image.
i2i
strengthnumber · 0–1
元画像をどれだけ変えるか。image-to-image のとき必須。How far to move from the source. Required for image-to-image.
i2i
aspect_ratiostring
既定 1:121: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.
optional
modelstring
既定 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-turbonegative_prompt 無視。

core: no image-to-image, ignores cfg_scale. sd3.5-large-turbo: ignores negative_prompt.
optional
output_formatstring
既定 pngpng / jpeg / webpDefault png. png / jpeg / webp.
optional
negative_promptstring
除外したい要素。sd3.5-large-turbo では無効。Elements to avoid. Ignored by sd3.5-large-turbo.
optional
seednumber
既定 0(ランダム)。0–4294967294。Default 0 (random). 0–4294967294.
optional
style_presetstring
photographic, anime, digital-art など。photographic, anime, digital-art, etc.
optional
cfg_scalenumber
プロンプト追従度。既定 4Prompt adherence. Default 4.
optional

リクエスト

Request

curl · text-to-image
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 · image-to-image
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

200
{
  "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).
エンドポイント
Endpoint

Upscale /upscale

画像を約 4 倍に拡大します。1MP を超える入力はアスペクト比を保って自動縮小されます。 Enlarges an image ~4×. Inputs over 1 MP are auto-downscaled, keeping aspect ratio.

POST/upscale
パラメータ
Parameter
説明
Description
imagestring
元画像の URL または data: URI。各辺 64px 以上。Source image URL or data: URI. ≥ 64px per side.
required
modestring
既定 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.
optional
promptstring
拡大時に保持・強調したい内容。conservative / creative では必須、fast では不要。What to preserve / emphasize. Required for conservative / creative, unused by fast.
optional
output_formatstring
既定 webppng / jpeg / webpDefault webp. png / jpeg / webp.
optional

リクエスト

Request

curl
curl -X POST https://api.necco.xyz/upscale \
  -d '{
    "image": "https://api.necco.xyz/img-public/1788732153475-yKIP8AcI.png",
    "mode": "fast"
  }'

レスポンス

Response

200
{
  "url": "https://api.necco.xyz/img-public/1788740012345-Ab3x_Q9z.webp"
}
エンドポイント
Endpoint

Edit /edit

既存画像の部分編集。mode で処理を選びます。すべて無料キープールで動作します。 Targeted edits on an existing image. Pick the operation with mode. All run on the free key pool.

POST/edit
パラメータ
Parameter
説明
Description
modestring
処理の種類:Operation: erase · inpaint · outpaint · remove-background · search-and-replace · search-and-recolor · replace-background-and-relight
required
imagestring
編集対象の URL / data: URI。replace-background-and-relight では代わりに subject_imageTarget image URL / data: URI. For replace-background-and-relight use subject_image instead.
required
promptstring
inpaint / search-and-replace / search-and-recolor で必須。生成したい内容。Required for inpaint / search-and-replace / search-and-recolor. What to paint in.
cond.
search_promptstring
search-and-replace で必須 — 置き換える対象を言葉で指定。Required for search-and-replace — describes what to swap out.
cond.
select_promptstring
search-and-recolor で必須 — 色を変える対象。Required for search-and-recolor — what to recolor.
cond.
left / right / up / downnumber
outpaint で各方向に拡張するピクセル数。最低1つ必須。Pixels to extend per side for outpaint. At least one required.
cond.
maskstring
erase / inpaint の任意マスク画像。省略時はアルファチャンネルを使用。Optional mask image for erase / inpaint. Falls back to the alpha channel.
optional
grow_masknumber
マスク境界を広げる px(既定 5)。Pixels to grow the mask edge (default 5).
optional
background_promptstring
replace-background-and-relight: 新しい背景の説明(または background_reference 画像)。どちらか必須。replace-background-and-relight: describe the new background (or pass a background_reference image). One is required.
cond.
output_formatstring
png / webp / jpegremove-backgroundpng / webp のみ。png / webp / jpeg. remove-background supports png / webp only.
optional
seed / negative_prompt / style_preset
Generate と同じ意味。Same meaning as in Generate.
optional

リクエスト

Request

curl · remove-background
curl -X POST https://api.necco.xyz/edit \
  -d '{
    "mode": "remove-background",
    "image": "https://api.necco.xyz/img-public/….png"
  }'
curl · search-and-replace
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

200
{
  "url": "https://api.necco.xyz/img-public/1788860319559-X0vej1B2.png"
}
入力は各辺 64px 以上・総画素 ≤ 9,437,184(超過分は自動縮小)。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.
エンドポイント
Endpoint

Control /control

参照画像の構図・輪郭・スタイルを保ったまま新しい画像を生成します。すべて無料キープールで動作します。 Generate a new image guided by a reference's structure, edges or style. All run on the free key pool.

POST/control
パラメータ
Parameter
説明
Description
modestring
ガイド方式:Guidance type: 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.
required
imagestring
structure / sketch / style の参照画像。Reference image for structure / sketch / style.
cond.
init_image + style_imagestring
style-transfer で必須 — 変換元と画風の2枚。Required for style-transfer — the base and the style source.
cond.
promptstring
structure / sketch / style で必須。style-transfer では任意。Required for structure / sketch / style. Optional for style-transfer.
cond.
control_strengthnumber · 0–1
structure / sketch: 参照への忠実度(既定 0.7)。structure / sketch: how closely to follow the reference (default 0.7).
optional
fidelitynumber · 0–1
style: 画風の強さ(既定 0.5)。style: strength of the style match (default 0.5).
optional
output_format / seed / negative_prompt
Generate と同じ。Same as Generate.
optional

リクエスト

Request

curl · sketch
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 · style-transfer
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

200
{
  "url": "https://api.necco.xyz/img-public/1788860332377-M22PYjHH.png"
}
入力サイズ制約は /edit と同じ。 Input size limits are the same as /edit.
エンドポイント
Endpoint

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.

POST/3d
パラメータ
Parameter
説明
Description
modestring
fast(Stable Fast 3D・速い)または spar3d(Stable Point Aware 3D・背面の推定が良い)。 fast (Stable Fast 3D, quick) or spar3d (Stable Point Aware 3D, better back-face reconstruction).
required
imagestring
物体画像の URL / 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.
required
texture_resolutionnumber
512 / 1024 / 2048(既定 1024)。512 / 1024 / 2048 (default 1024).
optional
foreground_rationumber
物体の余白比(既定 1.3)。Padding ratio around the object (default 1.3).
optional
remeshstring
none / quad / triangle(既定 none)。none / quad / triangle (default none).
optional
target_type / target_countspar3d
spar3d のみ: メッシュを vertex / face 数で制限。spar3d only: cap the mesh by vertex / face count.
optional

リクエスト

Request

curl
curl -X POST https://api.necco.xyz/3d \
  -d '{
    "mode": "fast",
    "image": "https://api.necco.xyz/img-public/….png",
    "texture_resolution": 1024
  }'

レスポンス

Response

200
{
  "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.
エンドポイント
Endpoint

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.

POST/audio
パラメータ
Parameter
説明
Description
modestring
text-to-audio · audio-to-audio · inpaint
required
promptstring
生成する音の説明(英語推奨)。Description of the sound (English recommended).
required
audiostring
audio-to-audio / inpaint で必須。mp3 / wav の URL または data: URI。Required for audio-to-audio / inpaint. mp3 / wav URL or data: URI.
cond.
durationnumber
秒。1–190(既定 190)。Seconds. 1–190 (default 190).
optional
output_formatstring
mp3 (既定)(default) / wav
optional
steps / cfg_scale / seednumber
サンプリング設定。Sampling controls.
optional

リクエスト

Request

curl · text-to-audio
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

200
{
  "url": "https://api.necco.xyz/img-public/1788860350016-AnbbxSmn.mp3"
}
エラー
Errors

エラーレスポンスError responses

失敗時は HTTP 4xx / 5xx と、次の形の JSON を返します。 On failure the API returns HTTP 4xx / 5xx with JSON of this shape.

example
{
  "error":  "prompt is empty",
  "code":   "NO_PROMPT",
  "at":     "validate-prompt"
}
code
意味
Meaning
http
NO_PROMPT
prompt が空。prompt is empty.
400
NO_IMAGE / INVALID_IMAGE
画像が無い / 形式・サイズが不正。Missing image / bad format or size.
400
MISSING_PARAM
/edit /control /audio で mode 必須のパラメータ(prompt / search_prompt / outpaint の方向など)が欠けている。A mode-required parameter is missing on /edit /control /audio (prompt, search_prompt, an outpaint direction, …).
400
INVALID_STRENGTH
strength が 0–1 の外。strength outside 0–1.
400
INVALID_MODEL / INVALID_MODE
未知の model / mode(有効値はレスポンスの models / modes 参照)。Unknown model / mode (valid values in the response's models / modes).
400
I2I_UNSUPPORTED
coreimage を渡した。image passed to core.
400
CONTENT_FILTERED
Stability のコンテンツフィルタで拒否。Blocked by Stability's content filter.
422
SUBJECT_NOT_DETECTED
/3d で画像から被写体を検出できなかった。/3d could not find a subject in the image.
422
PREMIUM_MODE_UNAVAILABLE
無料キープール(各25cr上限)では足りない操作 — conservative(≈40cr)/ creative(≈60cr)upscale。Operation the free key pool (25 cr/key cap) can't afford — conservative (~40 cr) / creative (~60 cr) upscale.
402
TRANSLATE_ERROR
日本語プロンプトの英訳に失敗(DeepL 側)。Japanese-prompt translation failed (DeepL side).
502
RATE_LIMIT
上流のレート制限。時間をおいて再試行。Upstream rate limit. Retry later.
429
UPSTREAM_ERROR / UPSTREAM_TIMEOUT
Stability 側の障害・タイムアウト。upstreamStatus に元コード。Stability-side failure / timeout. Original code in upstreamStatus.
502/504