画像生成 APIImage API
Stable Diffusion 3.5 による画像生成とアップスケール。認証もAPIキーも不要 — JSON を POST するだけ。 Stable Diffusion 3.5 image generation and upscaling. 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-image。text-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: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.optional
modelstring
既定
sd3.5-large。他 sd3.5-large-turbo / sd3.5-medium。Default sd3.5-large. Also sd3.5-large-turbo / sd3.5-medium.optional
output_formatstring
既定
png。png / jpeg / webp。Default 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
プロンプト追従度。既定
4。Prompt 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", "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 の入力画像は各辺 64–16384px・32 の倍数・総画素 ≤ 1,048,576。範囲外はリサイズされず拒否されます。
Images are stored under /img-public/ and served straight from the returned URL. image-to-image inputs must be 64–16384px per side, a multiple of 32, and ≤ 1,048,576 total pixels — out-of-range images are rejected, not resized.
エンドポイント
Endpoint
Upscale /upscale
Stable Diffusion Conservative Upscale。ディテールを保ったまま約 4 倍に拡大します。 Stable Diffusion Conservative Upscale — about 4×, preserving detail.
POST/upscale
パラメータ
Parameter
説明
Description
imagestring
元画像の URL または
data: URI。各辺 64–16384px・32 の倍数・総画素 ≤ 1,048,576。Source image URL or data: URI. 64–16384px per side, multiple of 32, ≤ 1,048,576 total pixels.required
promptstring
拡大時に保持・強調したい内容。Conservative upscale では必須。What to preserve / emphasize. Required by conservative upscale.
required
output_formatstring
既定
webp。png / jpeg / webp。Default 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", "prompt": "雪山と朝日、高精細snowy peak at dawn, high detail" }'
レスポンス
Response
200
{ "url": "https://api.necco.xyz/img-public/1788740012345-Ab3x_Q9z.webp" }
エラー
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
INVALID_STRENGTH
strength が 0–1 の外。strength outside 0–1.400
TRANSLATE_ERROR
日本語プロンプトの英訳に失敗。Failed to translate the Japanese prompt.
500
PUBLIC_FIGURE_DETECTED
実在の著名人を検出したため拒否。Rejected: a real public figure was detected.
500
RATE_LIMIT_EXCEEDED
上流のレート制限。時間をおいて再試行。Upstream rate limit. Retry later.
429
GENERATION_FAILED
生成が失敗(
detail 参照)。Generation failed (see detail).500