{ "type": "image_generation_prompt", "style": "Polaroid-style candid photography", "camera_style": { "camera": "Polaroid instant camera", "look": "ordinary snapshot", "effects": [ "slight blur", "soft focus", "flash-lit dark room glow", "light scattering from on-camera flash", "subtle film grain", "slight exposure falloff" ] }, "identity_preservation": { "use_reference_images": true, "strict_identity_lock": true, "alter_face": false, "notes": "Do not change or distort either person’s facial features, expressions, or proportions." }, "subjects": [ { "gender": "female", "identity": "user", "pose": "cute, casual pose standing close to the boy", "prop": "holding a burger", "expression": "natural, playful, candid" }, { "gender": "male", "identity": "boy from reference", "pose": "cute, relaxed pose next to the girl", "prop": "holding a red Coca-Cola can", "expression": "natural, playful, candid" } ], "interaction": { "relationship": "friendly and cute", "body_language": "standing close together, relaxed, slightly leaning toward each other" }, "environment": { "background": "plain white curtains", "location": "indoor room", "lighting": { "type": "single on-camera flash", "quality": "consistent, frontal flash lighting", "mood": "cozy, intimate, nostalgic" } }, "composition": { "framing": "medium shot", "angle": "eye-level", "balance": "centered, casual snapshot composition" }, "aesthetic": { "vibe": "cute, nostalgic, intimate", "era_feel": "classic instant film look", "imperfections": [ "minor blur", "soft edges", "natural exposure inconsistencies" ] }, "constraints": [ "No change to faces", "No dramatic posing", "No artificial glamour or studio look", "No text or watermarks", "Must look like a real Polaroid photo" ], "output_goal": "Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel." }
gpt-image-2/api/v1/gpt_image_2/text_to_image
运行信息
模型
gpt-image-2
提供方
OpenAI
服务
Gpt Image 2
Endpoint
Text To Image
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. 重启 Claude Code
3. 粘贴这个 prompt:生成一张图像:"{ "type": "image_generation_prompt", "style": "Polaroid-style candid photography", "camera_style": { "camera": "Polaroid instant camera", "look": "ordinary snapshot", "effects": [ "slight blur", "soft focus", "flash-lit dark room glow", "light scattering from on-camera flash", "subtle film grain", "slight exposure falloff" ] }, "identity_preservation": { "use_reference_images": true, "strict_identity_lock": true, "alter_face": false, "notes": "Do not change or distort either person’s facial features, expressions, or proportions." }, "subjects": [ { "gender": "female", "identity": "user", "pose": "cute, casual pose standing close to the boy", "prop": "holding a burger", "expression": "natural, playful, candid" }, { "gender": "male", "identity": "boy from reference", "pose": "cute, relaxed pose next to the girl", "prop": "holding a red Coca-Cola can", "expression": "natural, playful, candid" } ], "interaction": { "relationship": "friendly and cute", "body_language": "standing close together, relaxed, slightly leaning toward each other" }, "environment": { "background": "plain white curtains", "location": "indoor room", "lighting": { "type": "single on-camera flash", "quality": "consistent, frontal flash lighting", "mood": "cozy, intimate, nostalgic" } }, "composition": { "framing": "medium shot", "angle": "eye-level", "balance": "centered, casual snapshot composition" }, "aesthetic": { "vibe": "cute, nostalgic, intimate", "era_feel": "classic instant film look", "imperfections": [ "minor blur", "soft edges", "natural exposure inconsistencies" ] }, "constraints": [ "No change to faces", "No dramatic posing", "No artificial glamour or studio look", "No text or watermarks", "Must look like a real Polaroid photo" ], "output_goal": "Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel." }"
1. codex plugin install runapi-mcp@agents
2. 重启 Codex
3. 粘贴这个 prompt:生成一张图像:"{ "type": "image_generation_prompt", "style": "Polaroid-style candid photography", "camera_style": { "camera": "Polaroid instant camera", "look": "ordinary snapshot", "effects": [ "slight blur", "soft focus", "flash-lit dark room glow", "light scattering from on-camera flash", "subtle film grain", "slight exposure falloff" ] }, "identity_preservation": { "use_reference_images": true, "strict_identity_lock": true, "alter_face": false, "notes": "Do not change or distort either person’s facial features, expressions, or proportions." }, "subjects": [ { "gender": "female", "identity": "user", "pose": "cute, casual pose standing close to the boy", "prop": "holding a burger", "expression": "natural, playful, candid" }, { "gender": "male", "identity": "boy from reference", "pose": "cute, relaxed pose next to the girl", "prop": "holding a red Coca-Cola can", "expression": "natural, playful, candid" } ], "interaction": { "relationship": "friendly and cute", "body_language": "standing close together, relaxed, slightly leaning toward each other" }, "environment": { "background": "plain white curtains", "location": "indoor room", "lighting": { "type": "single on-camera flash", "quality": "consistent, frontal flash lighting", "mood": "cozy, intimate, nostalgic" } }, "composition": { "framing": "medium shot", "angle": "eye-level", "balance": "centered, casual snapshot composition" }, "aesthetic": { "vibe": "cute, nostalgic, intimate", "era_feel": "classic instant film look", "imperfections": [ "minor blur", "soft edges", "natural exposure inconsistencies" ] }, "constraints": [ "No change to faces", "No dramatic posing", "No artificial glamour or studio look", "No text or watermarks", "Must look like a real Polaroid photo" ], "output_goal": "Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel." }"
1. npx @runapi.ai/mcp init cursor
2. 重启 Cursor
3. 粘贴这个 prompt:生成一张图像:"{ "type": "image_generation_prompt", "style": "Polaroid-style candid photography", "camera_style": { "camera": "Polaroid instant camera", "look": "ordinary snapshot", "effects": [ "slight blur", "soft focus", "flash-lit dark room glow", "light scattering from on-camera flash", "subtle film grain", "slight exposure falloff" ] }, "identity_preservation": { "use_reference_images": true, "strict_identity_lock": true, "alter_face": false, "notes": "Do not change or distort either person’s facial features, expressions, or proportions." }, "subjects": [ { "gender": "female", "identity": "user", "pose": "cute, casual pose standing close to the boy", "prop": "holding a burger", "expression": "natural, playful, candid" }, { "gender": "male", "identity": "boy from reference", "pose": "cute, relaxed pose next to the girl", "prop": "holding a red Coca-Cola can", "expression": "natural, playful, candid" } ], "interaction": { "relationship": "friendly and cute", "body_language": "standing close together, relaxed, slightly leaning toward each other" }, "environment": { "background": "plain white curtains", "location": "indoor room", "lighting": { "type": "single on-camera flash", "quality": "consistent, frontal flash lighting", "mood": "cozy, intimate, nostalgic" } }, "composition": { "framing": "medium shot", "angle": "eye-level", "balance": "centered, casual snapshot composition" }, "aesthetic": { "vibe": "cute, nostalgic, intimate", "era_feel": "classic instant film look", "imperfections": [ "minor blur", "soft edges", "natural exposure inconsistencies" ] }, "constraints": [ "No change to faces", "No dramatic posing", "No artificial glamour or studio look", "No text or watermarks", "Must look like a real Polaroid photo" ], "output_goal": "Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel." }"
1. npx @runapi.ai/mcp init windsurf
2. 重启 Windsurf
3. 粘贴这个 prompt:生成一张图像:"{ "type": "image_generation_prompt", "style": "Polaroid-style candid photography", "camera_style": { "camera": "Polaroid instant camera", "look": "ordinary snapshot", "effects": [ "slight blur", "soft focus", "flash-lit dark room glow", "light scattering from on-camera flash", "subtle film grain", "slight exposure falloff" ] }, "identity_preservation": { "use_reference_images": true, "strict_identity_lock": true, "alter_face": false, "notes": "Do not change or distort either person’s facial features, expressions, or proportions." }, "subjects": [ { "gender": "female", "identity": "user", "pose": "cute, casual pose standing close to the boy", "prop": "holding a burger", "expression": "natural, playful, candid" }, { "gender": "male", "identity": "boy from reference", "pose": "cute, relaxed pose next to the girl", "prop": "holding a red Coca-Cola can", "expression": "natural, playful, candid" } ], "interaction": { "relationship": "friendly and cute", "body_language": "standing close together, relaxed, slightly leaning toward each other" }, "environment": { "background": "plain white curtains", "location": "indoor room", "lighting": { "type": "single on-camera flash", "quality": "consistent, frontal flash lighting", "mood": "cozy, intimate, nostalgic" } }, "composition": { "framing": "medium shot", "angle": "eye-level", "balance": "centered, casual snapshot composition" }, "aesthetic": { "vibe": "cute, nostalgic, intimate", "era_feel": "classic instant film look", "imperfections": [ "minor blur", "soft edges", "natural exposure inconsistencies" ] }, "constraints": [ "No change to faces", "No dramatic posing", "No artificial glamour or studio look", "No text or watermarks", "Must look like a real Polaroid photo" ], "output_goal": "Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel." }"
curl -X POST https://runapi.ai/api/v1/gpt_image_2/text_to_image \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"model": "gpt-image-2",
"prompt": "{ \"type\": \"image_generation_prompt\", \"style\": \"Polaroid-style candid photography\", \"camera_style\": { \"camera\": \"Polaroid instant camera\", \"look\": \"ordinary snapshot\", \"effects\": [ \"slight blur\", \"soft focus\", \"flash-lit dark room glow\", \"light scattering from on-camera flash\", \"subtle film grain\", \"slight exposure falloff\" ] }, \"identity_preservation\": { \"use_reference_images\": true, \"strict_identity_lock\": true, \"alter_face\": false, \"notes\": \"Do not change or distort either person’s facial features, expressions, or proportions.\" }, \"subjects\": [ { \"gender\": \"female\", \"identity\": \"user\", \"pose\": \"cute, casual pose standing close to the boy\", \"prop\": \"holding a burger\", \"expression\": \"natural, playful, candid\" }, { \"gender\": \"male\", \"identity\": \"boy from reference\", \"pose\": \"cute, relaxed pose next to the girl\", \"prop\": \"holding a red Coca-Cola can\", \"expression\": \"natural, playful, candid\" } ], \"interaction\": { \"relationship\": \"friendly and cute\", \"body_language\": \"standing close together, relaxed, slightly leaning toward each other\" }, \"environment\": { \"background\": \"plain white curtains\", \"location\": \"indoor room\", \"lighting\": { \"type\": \"single on-camera flash\", \"quality\": \"consistent, frontal flash lighting\", \"mood\": \"cozy, intimate, nostalgic\" } }, \"composition\": { \"framing\": \"medium shot\", \"angle\": \"eye-level\", \"balance\": \"centered, casual snapshot composition\" }, \"aesthetic\": { \"vibe\": \"cute, nostalgic, intimate\", \"era_feel\": \"classic instant film look\", \"imperfections\": [ \"minor blur\", \"soft edges\", \"natural exposure inconsistencies\" ] }, \"constraints\": [ \"No change to faces\", \"No dramatic posing\", \"No artificial glamour or studio look\", \"No text or watermarks\", \"Must look like a real Polaroid photo\" ], \"output_goal\": \"Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel.\" }"
}
JSON
import { GptImage2Client } from "@runapi.ai/gpt-image-2";
const client = new GptImage2Client({
apiKey: process.env.RUNAPI_API_KEY,
});
const result = await client.textToImage.run({
"model": "gpt-image-2",
"prompt": "{ \"type\": \"image_generation_prompt\", \"style\": \"Polaroid-style candid photography\", \"camera_style\": { \"camera\": \"Polaroid instant camera\", \"look\": \"ordinary snapshot\", \"effects\": [ \"slight blur\", \"soft focus\", \"flash-lit dark room glow\", \"light scattering from on-camera flash\", \"subtle film grain\", \"slight exposure falloff\" ] }, \"identity_preservation\": { \"use_reference_images\": true, \"strict_identity_lock\": true, \"alter_face\": false, \"notes\": \"Do not change or distort either person’s facial features, expressions, or proportions.\" }, \"subjects\": [ { \"gender\": \"female\", \"identity\": \"user\", \"pose\": \"cute, casual pose standing close to the boy\", \"prop\": \"holding a burger\", \"expression\": \"natural, playful, candid\" }, { \"gender\": \"male\", \"identity\": \"boy from reference\", \"pose\": \"cute, relaxed pose next to the girl\", \"prop\": \"holding a red Coca-Cola can\", \"expression\": \"natural, playful, candid\" } ], \"interaction\": { \"relationship\": \"friendly and cute\", \"body_language\": \"standing close together, relaxed, slightly leaning toward each other\" }, \"environment\": { \"background\": \"plain white curtains\", \"location\": \"indoor room\", \"lighting\": { \"type\": \"single on-camera flash\", \"quality\": \"consistent, frontal flash lighting\", \"mood\": \"cozy, intimate, nostalgic\" } }, \"composition\": { \"framing\": \"medium shot\", \"angle\": \"eye-level\", \"balance\": \"centered, casual snapshot composition\" }, \"aesthetic\": { \"vibe\": \"cute, nostalgic, intimate\", \"era_feel\": \"classic instant film look\", \"imperfections\": [ \"minor blur\", \"soft edges\", \"natural exposure inconsistencies\" ] }, \"constraints\": [ \"No change to faces\", \"No dramatic posing\", \"No artificial glamour or studio look\", \"No text or watermarks\", \"Must look like a real Polaroid photo\" ], \"output_goal\": \"Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel.\" }"
});
console.log(result.id);
require "runapi/gpt_image_2"
client = RunApi::GptImage2::Client.new
result = client.text_to_image.run(
model: "gpt-image-2",
prompt: "{ \"type\": \"image_generation_prompt\", \"style\": \"Polaroid-style candid photography\", \"camera_style\": { \"camera\": \"Polaroid instant camera\", \"look\": \"ordinary snapshot\", \"effects\": [ \"slight blur\", \"soft focus\", \"flash-lit dark room glow\", \"light scattering from on-camera flash\", \"subtle film grain\", \"slight exposure falloff\" ] }, \"identity_preservation\": { \"use_reference_images\": true, \"strict_identity_lock\": true, \"alter_face\": false, \"notes\": \"Do not change or distort either person’s facial features, expressions, or proportions.\" }, \"subjects\": [ { \"gender\": \"female\", \"identity\": \"user\", \"pose\": \"cute, casual pose standing close to the boy\", \"prop\": \"holding a burger\", \"expression\": \"natural, playful, candid\" }, { \"gender\": \"male\", \"identity\": \"boy from reference\", \"pose\": \"cute, relaxed pose next to the girl\", \"prop\": \"holding a red Coca-Cola can\", \"expression\": \"natural, playful, candid\" } ], \"interaction\": { \"relationship\": \"friendly and cute\", \"body_language\": \"standing close together, relaxed, slightly leaning toward each other\" }, \"environment\": { \"background\": \"plain white curtains\", \"location\": \"indoor room\", \"lighting\": { \"type\": \"single on-camera flash\", \"quality\": \"consistent, frontal flash lighting\", \"mood\": \"cozy, intimate, nostalgic\" } }, \"composition\": { \"framing\": \"medium shot\", \"angle\": \"eye-level\", \"balance\": \"centered, casual snapshot composition\" }, \"aesthetic\": { \"vibe\": \"cute, nostalgic, intimate\", \"era_feel\": \"classic instant film look\", \"imperfections\": [ \"minor blur\", \"soft edges\", \"natural exposure inconsistencies\" ] }, \"constraints\": [ \"No change to faces\", \"No dramatic posing\", \"No artificial glamour or studio look\", \"No text or watermarks\", \"Must look like a real Polaroid photo\" ], \"output_goal\": \"Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel.\" }"
)
puts result.id
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader("{\"model\":\"gpt-image-2\",\"prompt\":\"{ \\\"type\\\": \\\"image_generation_prompt\\\", \\\"style\\\": \\\"Polaroid-style candid photography\\\", \\\"camera_style\\\": { \\\"camera\\\": \\\"Polaroid instant camera\\\", \\\"look\\\": \\\"ordinary snapshot\\\", \\\"effects\\\": [ \\\"slight blur\\\", \\\"soft focus\\\", \\\"flash-lit dark room glow\\\", \\\"light scattering from on-camera flash\\\", \\\"subtle film grain\\\", \\\"slight exposure falloff\\\" ] }, \\\"identity_preservation\\\": { \\\"use_reference_images\\\": true, \\\"strict_identity_lock\\\": true, \\\"alter_face\\\": false, \\\"notes\\\": \\\"Do not change or distort either person’s facial features, expressions, or proportions.\\\" }, \\\"subjects\\\": [ { \\\"gender\\\": \\\"female\\\", \\\"identity\\\": \\\"user\\\", \\\"pose\\\": \\\"cute, casual pose standing close to the boy\\\", \\\"prop\\\": \\\"holding a burger\\\", \\\"expression\\\": \\\"natural, playful, candid\\\" }, { \\\"gender\\\": \\\"male\\\", \\\"identity\\\": \\\"boy from reference\\\", \\\"pose\\\": \\\"cute, relaxed pose next to the girl\\\", \\\"prop\\\": \\\"holding a red Coca-Cola can\\\", \\\"expression\\\": \\\"natural, playful, candid\\\" } ], \\\"interaction\\\": { \\\"relationship\\\": \\\"friendly and cute\\\", \\\"body_language\\\": \\\"standing close together, relaxed, slightly leaning toward each other\\\" }, \\\"environment\\\": { \\\"background\\\": \\\"plain white curtains\\\", \\\"location\\\": \\\"indoor room\\\", \\\"lighting\\\": { \\\"type\\\": \\\"single on-camera flash\\\", \\\"quality\\\": \\\"consistent, frontal flash lighting\\\", \\\"mood\\\": \\\"cozy, intimate, nostalgic\\\" } }, \\\"composition\\\": { \\\"framing\\\": \\\"medium shot\\\", \\\"angle\\\": \\\"eye-level\\\", \\\"balance\\\": \\\"centered, casual snapshot composition\\\" }, \\\"aesthetic\\\": { \\\"vibe\\\": \\\"cute, nostalgic, intimate\\\", \\\"era_feel\\\": \\\"classic instant film look\\\", \\\"imperfections\\\": [ \\\"minor blur\\\", \\\"soft edges\\\", \\\"natural exposure inconsistencies\\\" ] }, \\\"constraints\\\": [ \\\"No change to faces\\\", \\\"No dramatic posing\\\", \\\"No artificial glamour or studio look\\\", \\\"No text or watermarks\\\", \\\"Must look like a real Polaroid photo\\\" ], \\\"output_goal\\\": \\\"Create a realistic Polaroid-style instant photo of a boy and girl posing cutely together indoors, with white curtains behind them, flash-lit from a dark room, the boy holding a red Coca-Cola can and the girl holding a burger, maintaining an authentic, nostalgic snapshot feel.\\\" }\"}")
req, err := http.NewRequestWithContext(context.Background(), http.MethodPost, "https://runapi.ai/api/v1/gpt_image_2/text_to_image", body)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("RUNAPI_API_KEY"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
}
gpt-image-2/api/v1/gpt_image_2/text_to_image获取 API Key
Low-angle fashion campaign photograph of a confident model holding a large [product name] very close to the camera, exaggerated perspective with the hand and product dominating the foreground, full-body pose visible in the background, wide stance, dynamic posture, clean pure white studio background, high-key lighting, sharp focus on product, slight depth of field on the model, bold colorful outfit with strong contrast tones, modern beauty advertising aesthetic, ultra-clean composition, commercial studio photography, glossy packaging detail visible, crisp shadows
curl -X POST https://runapi.ai/api/v1/gpt_image_2/text_to_image \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"model": "gpt-image-2",
"prompt": "Low-angle fashion campaign photograph of a confident model holding a large [product name] very close to the camera, exaggerated perspective with the hand and product dominating the foreground, full-body pose visible in the background, wide stance, dynamic posture, clean pure white studio background, high-key lighting, sharp focus on product, slight depth of field on the model, bold colorful outfit with strong contrast tones, modern beauty advertising aesthetic, ultra-clean composition, commercial studio photography, glossy packaging detail visible, crisp shadows"
}
JSON
Create an infographic image of [LANDMARK], combining a real photograph of the landmark with blueprint-style technical annotations and diagrams overlaid on the image. Include the title “[LANDMARK]” in a hand-drawn box in the corner. Add white chalk-style sketches showing key structural data, important measurements, material quantities, internal diagrams, load-flow arrows, cross-sections, floor plans, and notable architectural or engineering features. Style: blueprint aesthetic with white line drawings on the photograph, technical/architectural annotation style, educational infographic feel, with the real environment visible behind the annotations.
curl -X POST https://runapi.ai/api/v1/gpt_image_2/text_to_image \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"model": "gpt-image-2",
"prompt": "Create an infographic image of [LANDMARK], combining a real photograph of the landmark with blueprint-style technical annotations and diagrams overlaid on the image. Include the title “[LANDMARK]” in a hand-drawn box in the corner. Add white chalk-style sketches showing key structural data, important measurements, material quantities, internal diagrams, load-flow arrows, cross-sections, floor plans, and notable architectural or engineering features. Style: blueprint aesthetic with white line drawings on the photograph, technical/architectural annotation style, educational infographic feel, with the real environment visible behind the annotations."
}
JSON