复制
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. 重启 Claude Code
3. 粘贴这个 prompt:生成一张图像:"Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
复制
1. codex plugin install runapi-mcp@agents
2. 重启 Codex
3. 粘贴这个 prompt:生成一张图像:"Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
复制
1. npx @runapi.ai/mcp init cursor
2. 重启 Cursor
3. 粘贴这个 prompt:生成一张图像:"Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
复制
1. npx @runapi.ai/mcp init windsurf
2. 重启 Windsurf
3. 粘贴这个 prompt:生成一张图像:"Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
curl
Node.js
Ruby
Go
复制
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 a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
}
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": "Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
});
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: "Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop"
)
puts result.id
复制
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader("{\"model\":\"gpt-image-2\",\"prompt\":\"Create a hyper-realistic cinematic luxury perfume product photograph featuring [PERFUME BOTTLE DESIGN] positioned in [COMPOSITION / ANGLE] within a dramatic elemental environment of [ELEMENTAL SETTING: water, smoke, ice, firelight, forest, florals, spices, gemstones]. The bottle should feel premium and tactile, with [MATERIAL DETAILS: glossy glass, metallic cap, gold label, transparent liquid, frosted surface, engraved text], sharp reflections, realistic refractions, and crisp readable branding: [BRAND / LABEL TEXT]. Surround the product with carefully arranged sensory ingredients such as [BOTANICALS / SPICES / FRUITS / OBJECTS], using strong contrast between [PRIMARY COLOR PALETTE] and [ACCENT COLORS]. Lighting should be cinematic and high-contrast, with [LIGHTING STYLE], deep shadows, sparkling highlights, volumetric atmosphere, and a luxurious commercial advertising finish. Background: [BACKGROUND DESCRIPTION], shallow depth of field, premium editorial composition, ultra-detailed textures, 8k resolution, photorealistic studio quality. Cheat Sheet [PERFUME BOTTLE DESIGN]: shape, color, cap, label style [COMPOSITION / ANGLE]: tilted crash, centered still life, close-up tray, hand interaction [ELEMENTAL SETTING]: splash, smoke, candlelight, ice, forest, aurora [MATERIAL DETAILS]: glass, metal, liquid, frost, reflections [BRAND / LABEL TEXT]: exact readable perfume text [BOTANICALS / SPICES / FRUITS / OBJECTS]: lemons, vanilla pods, roses, pinecones, gemstones [PRIMARY COLOR PALETTE]: navy, amber, silver, black, icy blue [ACCENT COLORS]: gold, red, lime green, magenta, teal [LIGHTING STYLE]: dramatic spotlight, candle glow, cool moonlight, golden rim light [BACKGROUND DESCRIPTION]: moody studio, dark forest, blurred luxury interior, smoky backdrop\"}")
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)
}