复制
1. claude mcp add runapi -s user -- npx -y @runapi.ai/mcp
2. 重启 Claude Code
3. 粘贴这个 prompt:生成一张图像:"{ "image_type": "portrait_photography", "resolution_target": "8K UHD", "aspect_ratio": "vertical", "frame_composition": { "crop": "mid-chest to head", "orientation": "portrait", "subject_position": "centered", "camera_angle": "eye-level", "perspective": "straight-on" }, "subject": { "gender_presentation": "female", "age_appearance": "young adult", "face": { "shape": "oval", "skin_tone": "fair with neutral undertone", "skin_texture": "smooth, natural, visible realism, no heavy retouching", "facial_features": { "eyes": { "color": "light blue-green", "shape": "almond-shaped", "gaze_direction": "directly toward camera", "eyelids": "slightly relaxed", "eyelashes": "natural length, not exaggerated" }, "eyebrows": { "color": "dark brown", "thickness": "medium", "shape": "soft natural arch" }, "nose": { "shape": "straight", "size": "proportionate", "bridge": "smooth" }, "lips": { "color": "soft natural pink", "fullness": "medium to full", "state": "slightly parted" } }, "expression": "neutral, calm, composed" }, "hair": { "color": "dark brown", "length": "short to medium", "style": "loose, slightly wavy", "movement": "wind-blown strands crossing face", "parting": "natural, unstructured" } }, "clothing": { "outerwear": { "type": "coat", "color": "deep royal blue", "material_appearance": "wool or felt-like texture", "fit": "structured but relaxed", "visible_details": "clean seams, minimal design" }, "accessory": { "type": "scarf", "color": "matching royal blue", "material_appearance": "soft, fabric texture", "placement": "wrapped loosely around neck" } }, "color_palette": { "dominant_colors": [ "royal blue", "deep blue", "soft skin tones" ], "contrast": "high contrast between blue clothing and lighter skin", "color_temperature": "cool" }, "lighting": { "type": "natural light", "direction": "frontal with slight side softness", "intensity": "moderate", "shadows": "soft, minimal harsh shadows", "highlights": "subtle highlights on cheekbones and lips" }, "background": { "environment": "open outdoor setting", "elements": "blurred horizon line, blue gradient background", "depth_of_field": "shallow", "background_detail": "intentionally out of focus", "color": "blue gradient resembling sky and distant water" }, "image_style": { "realism": "high realism with subtle AI polish", "sharpness": "high facial detail", "texture_detail": "visible fabric texture and skin detail", "noise": "minimal", "post_processing": "clean color grading, no heavy filters" }, "mood": { "overall_feel": "calm, serene, minimalistic", "visual_energy": "soft and composed" }, "generation_constraints": { "preserve_original_composition": true, "preserve_subject_structure": true, "no_face_alteration": true, "no_style_assumptions": true, "do_not_change_image_size": true } }"
复制
1. codex plugin install runapi-mcp@agents
2. 重启 Codex
3. 粘贴这个 prompt:生成一张图像:"{ "image_type": "portrait_photography", "resolution_target": "8K UHD", "aspect_ratio": "vertical", "frame_composition": { "crop": "mid-chest to head", "orientation": "portrait", "subject_position": "centered", "camera_angle": "eye-level", "perspective": "straight-on" }, "subject": { "gender_presentation": "female", "age_appearance": "young adult", "face": { "shape": "oval", "skin_tone": "fair with neutral undertone", "skin_texture": "smooth, natural, visible realism, no heavy retouching", "facial_features": { "eyes": { "color": "light blue-green", "shape": "almond-shaped", "gaze_direction": "directly toward camera", "eyelids": "slightly relaxed", "eyelashes": "natural length, not exaggerated" }, "eyebrows": { "color": "dark brown", "thickness": "medium", "shape": "soft natural arch" }, "nose": { "shape": "straight", "size": "proportionate", "bridge": "smooth" }, "lips": { "color": "soft natural pink", "fullness": "medium to full", "state": "slightly parted" } }, "expression": "neutral, calm, composed" }, "hair": { "color": "dark brown", "length": "short to medium", "style": "loose, slightly wavy", "movement": "wind-blown strands crossing face", "parting": "natural, unstructured" } }, "clothing": { "outerwear": { "type": "coat", "color": "deep royal blue", "material_appearance": "wool or felt-like texture", "fit": "structured but relaxed", "visible_details": "clean seams, minimal design" }, "accessory": { "type": "scarf", "color": "matching royal blue", "material_appearance": "soft, fabric texture", "placement": "wrapped loosely around neck" } }, "color_palette": { "dominant_colors": [ "royal blue", "deep blue", "soft skin tones" ], "contrast": "high contrast between blue clothing and lighter skin", "color_temperature": "cool" }, "lighting": { "type": "natural light", "direction": "frontal with slight side softness", "intensity": "moderate", "shadows": "soft, minimal harsh shadows", "highlights": "subtle highlights on cheekbones and lips" }, "background": { "environment": "open outdoor setting", "elements": "blurred horizon line, blue gradient background", "depth_of_field": "shallow", "background_detail": "intentionally out of focus", "color": "blue gradient resembling sky and distant water" }, "image_style": { "realism": "high realism with subtle AI polish", "sharpness": "high facial detail", "texture_detail": "visible fabric texture and skin detail", "noise": "minimal", "post_processing": "clean color grading, no heavy filters" }, "mood": { "overall_feel": "calm, serene, minimalistic", "visual_energy": "soft and composed" }, "generation_constraints": { "preserve_original_composition": true, "preserve_subject_structure": true, "no_face_alteration": true, "no_style_assumptions": true, "do_not_change_image_size": true } }"
复制
1. npx @runapi.ai/mcp init cursor
2. 重启 Cursor
3. 粘贴这个 prompt:生成一张图像:"{ "image_type": "portrait_photography", "resolution_target": "8K UHD", "aspect_ratio": "vertical", "frame_composition": { "crop": "mid-chest to head", "orientation": "portrait", "subject_position": "centered", "camera_angle": "eye-level", "perspective": "straight-on" }, "subject": { "gender_presentation": "female", "age_appearance": "young adult", "face": { "shape": "oval", "skin_tone": "fair with neutral undertone", "skin_texture": "smooth, natural, visible realism, no heavy retouching", "facial_features": { "eyes": { "color": "light blue-green", "shape": "almond-shaped", "gaze_direction": "directly toward camera", "eyelids": "slightly relaxed", "eyelashes": "natural length, not exaggerated" }, "eyebrows": { "color": "dark brown", "thickness": "medium", "shape": "soft natural arch" }, "nose": { "shape": "straight", "size": "proportionate", "bridge": "smooth" }, "lips": { "color": "soft natural pink", "fullness": "medium to full", "state": "slightly parted" } }, "expression": "neutral, calm, composed" }, "hair": { "color": "dark brown", "length": "short to medium", "style": "loose, slightly wavy", "movement": "wind-blown strands crossing face", "parting": "natural, unstructured" } }, "clothing": { "outerwear": { "type": "coat", "color": "deep royal blue", "material_appearance": "wool or felt-like texture", "fit": "structured but relaxed", "visible_details": "clean seams, minimal design" }, "accessory": { "type": "scarf", "color": "matching royal blue", "material_appearance": "soft, fabric texture", "placement": "wrapped loosely around neck" } }, "color_palette": { "dominant_colors": [ "royal blue", "deep blue", "soft skin tones" ], "contrast": "high contrast between blue clothing and lighter skin", "color_temperature": "cool" }, "lighting": { "type": "natural light", "direction": "frontal with slight side softness", "intensity": "moderate", "shadows": "soft, minimal harsh shadows", "highlights": "subtle highlights on cheekbones and lips" }, "background": { "environment": "open outdoor setting", "elements": "blurred horizon line, blue gradient background", "depth_of_field": "shallow", "background_detail": "intentionally out of focus", "color": "blue gradient resembling sky and distant water" }, "image_style": { "realism": "high realism with subtle AI polish", "sharpness": "high facial detail", "texture_detail": "visible fabric texture and skin detail", "noise": "minimal", "post_processing": "clean color grading, no heavy filters" }, "mood": { "overall_feel": "calm, serene, minimalistic", "visual_energy": "soft and composed" }, "generation_constraints": { "preserve_original_composition": true, "preserve_subject_structure": true, "no_face_alteration": true, "no_style_assumptions": true, "do_not_change_image_size": true } }"
复制
1. npx @runapi.ai/mcp init windsurf
2. 重启 Windsurf
3. 粘贴这个 prompt:生成一张图像:"{ "image_type": "portrait_photography", "resolution_target": "8K UHD", "aspect_ratio": "vertical", "frame_composition": { "crop": "mid-chest to head", "orientation": "portrait", "subject_position": "centered", "camera_angle": "eye-level", "perspective": "straight-on" }, "subject": { "gender_presentation": "female", "age_appearance": "young adult", "face": { "shape": "oval", "skin_tone": "fair with neutral undertone", "skin_texture": "smooth, natural, visible realism, no heavy retouching", "facial_features": { "eyes": { "color": "light blue-green", "shape": "almond-shaped", "gaze_direction": "directly toward camera", "eyelids": "slightly relaxed", "eyelashes": "natural length, not exaggerated" }, "eyebrows": { "color": "dark brown", "thickness": "medium", "shape": "soft natural arch" }, "nose": { "shape": "straight", "size": "proportionate", "bridge": "smooth" }, "lips": { "color": "soft natural pink", "fullness": "medium to full", "state": "slightly parted" } }, "expression": "neutral, calm, composed" }, "hair": { "color": "dark brown", "length": "short to medium", "style": "loose, slightly wavy", "movement": "wind-blown strands crossing face", "parting": "natural, unstructured" } }, "clothing": { "outerwear": { "type": "coat", "color": "deep royal blue", "material_appearance": "wool or felt-like texture", "fit": "structured but relaxed", "visible_details": "clean seams, minimal design" }, "accessory": { "type": "scarf", "color": "matching royal blue", "material_appearance": "soft, fabric texture", "placement": "wrapped loosely around neck" } }, "color_palette": { "dominant_colors": [ "royal blue", "deep blue", "soft skin tones" ], "contrast": "high contrast between blue clothing and lighter skin", "color_temperature": "cool" }, "lighting": { "type": "natural light", "direction": "frontal with slight side softness", "intensity": "moderate", "shadows": "soft, minimal harsh shadows", "highlights": "subtle highlights on cheekbones and lips" }, "background": { "environment": "open outdoor setting", "elements": "blurred horizon line, blue gradient background", "depth_of_field": "shallow", "background_detail": "intentionally out of focus", "color": "blue gradient resembling sky and distant water" }, "image_style": { "realism": "high realism with subtle AI polish", "sharpness": "high facial detail", "texture_detail": "visible fabric texture and skin detail", "noise": "minimal", "post_processing": "clean color grading, no heavy filters" }, "mood": { "overall_feel": "calm, serene, minimalistic", "visual_energy": "soft and composed" }, "generation_constraints": { "preserve_original_composition": true, "preserve_subject_structure": true, "no_face_alteration": true, "no_style_assumptions": true, "do_not_change_image_size": true } }"
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": "{ \"image_type\": \"portrait_photography\", \"resolution_target\": \"8K UHD\", \"aspect_ratio\": \"vertical\", \"frame_composition\": { \"crop\": \"mid-chest to head\", \"orientation\": \"portrait\", \"subject_position\": \"centered\", \"camera_angle\": \"eye-level\", \"perspective\": \"straight-on\" }, \"subject\": { \"gender_presentation\": \"female\", \"age_appearance\": \"young adult\", \"face\": { \"shape\": \"oval\", \"skin_tone\": \"fair with neutral undertone\", \"skin_texture\": \"smooth, natural, visible realism, no heavy retouching\", \"facial_features\": { \"eyes\": { \"color\": \"light blue-green\", \"shape\": \"almond-shaped\", \"gaze_direction\": \"directly toward camera\", \"eyelids\": \"slightly relaxed\", \"eyelashes\": \"natural length, not exaggerated\" }, \"eyebrows\": { \"color\": \"dark brown\", \"thickness\": \"medium\", \"shape\": \"soft natural arch\" }, \"nose\": { \"shape\": \"straight\", \"size\": \"proportionate\", \"bridge\": \"smooth\" }, \"lips\": { \"color\": \"soft natural pink\", \"fullness\": \"medium to full\", \"state\": \"slightly parted\" } }, \"expression\": \"neutral, calm, composed\" }, \"hair\": { \"color\": \"dark brown\", \"length\": \"short to medium\", \"style\": \"loose, slightly wavy\", \"movement\": \"wind-blown strands crossing face\", \"parting\": \"natural, unstructured\" } }, \"clothing\": { \"outerwear\": { \"type\": \"coat\", \"color\": \"deep royal blue\", \"material_appearance\": \"wool or felt-like texture\", \"fit\": \"structured but relaxed\", \"visible_details\": \"clean seams, minimal design\" }, \"accessory\": { \"type\": \"scarf\", \"color\": \"matching royal blue\", \"material_appearance\": \"soft, fabric texture\", \"placement\": \"wrapped loosely around neck\" } }, \"color_palette\": { \"dominant_colors\": [ \"royal blue\", \"deep blue\", \"soft skin tones\" ], \"contrast\": \"high contrast between blue clothing and lighter skin\", \"color_temperature\": \"cool\" }, \"lighting\": { \"type\": \"natural light\", \"direction\": \"frontal with slight side softness\", \"intensity\": \"moderate\", \"shadows\": \"soft, minimal harsh shadows\", \"highlights\": \"subtle highlights on cheekbones and lips\" }, \"background\": { \"environment\": \"open outdoor setting\", \"elements\": \"blurred horizon line, blue gradient background\", \"depth_of_field\": \"shallow\", \"background_detail\": \"intentionally out of focus\", \"color\": \"blue gradient resembling sky and distant water\" }, \"image_style\": { \"realism\": \"high realism with subtle AI polish\", \"sharpness\": \"high facial detail\", \"texture_detail\": \"visible fabric texture and skin detail\", \"noise\": \"minimal\", \"post_processing\": \"clean color grading, no heavy filters\" }, \"mood\": { \"overall_feel\": \"calm, serene, minimalistic\", \"visual_energy\": \"soft and composed\" }, \"generation_constraints\": { \"preserve_original_composition\": true, \"preserve_subject_structure\": true, \"no_face_alteration\": true, \"no_style_assumptions\": true, \"do_not_change_image_size\": true } }"
}
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": "{ \"image_type\": \"portrait_photography\", \"resolution_target\": \"8K UHD\", \"aspect_ratio\": \"vertical\", \"frame_composition\": { \"crop\": \"mid-chest to head\", \"orientation\": \"portrait\", \"subject_position\": \"centered\", \"camera_angle\": \"eye-level\", \"perspective\": \"straight-on\" }, \"subject\": { \"gender_presentation\": \"female\", \"age_appearance\": \"young adult\", \"face\": { \"shape\": \"oval\", \"skin_tone\": \"fair with neutral undertone\", \"skin_texture\": \"smooth, natural, visible realism, no heavy retouching\", \"facial_features\": { \"eyes\": { \"color\": \"light blue-green\", \"shape\": \"almond-shaped\", \"gaze_direction\": \"directly toward camera\", \"eyelids\": \"slightly relaxed\", \"eyelashes\": \"natural length, not exaggerated\" }, \"eyebrows\": { \"color\": \"dark brown\", \"thickness\": \"medium\", \"shape\": \"soft natural arch\" }, \"nose\": { \"shape\": \"straight\", \"size\": \"proportionate\", \"bridge\": \"smooth\" }, \"lips\": { \"color\": \"soft natural pink\", \"fullness\": \"medium to full\", \"state\": \"slightly parted\" } }, \"expression\": \"neutral, calm, composed\" }, \"hair\": { \"color\": \"dark brown\", \"length\": \"short to medium\", \"style\": \"loose, slightly wavy\", \"movement\": \"wind-blown strands crossing face\", \"parting\": \"natural, unstructured\" } }, \"clothing\": { \"outerwear\": { \"type\": \"coat\", \"color\": \"deep royal blue\", \"material_appearance\": \"wool or felt-like texture\", \"fit\": \"structured but relaxed\", \"visible_details\": \"clean seams, minimal design\" }, \"accessory\": { \"type\": \"scarf\", \"color\": \"matching royal blue\", \"material_appearance\": \"soft, fabric texture\", \"placement\": \"wrapped loosely around neck\" } }, \"color_palette\": { \"dominant_colors\": [ \"royal blue\", \"deep blue\", \"soft skin tones\" ], \"contrast\": \"high contrast between blue clothing and lighter skin\", \"color_temperature\": \"cool\" }, \"lighting\": { \"type\": \"natural light\", \"direction\": \"frontal with slight side softness\", \"intensity\": \"moderate\", \"shadows\": \"soft, minimal harsh shadows\", \"highlights\": \"subtle highlights on cheekbones and lips\" }, \"background\": { \"environment\": \"open outdoor setting\", \"elements\": \"blurred horizon line, blue gradient background\", \"depth_of_field\": \"shallow\", \"background_detail\": \"intentionally out of focus\", \"color\": \"blue gradient resembling sky and distant water\" }, \"image_style\": { \"realism\": \"high realism with subtle AI polish\", \"sharpness\": \"high facial detail\", \"texture_detail\": \"visible fabric texture and skin detail\", \"noise\": \"minimal\", \"post_processing\": \"clean color grading, no heavy filters\" }, \"mood\": { \"overall_feel\": \"calm, serene, minimalistic\", \"visual_energy\": \"soft and composed\" }, \"generation_constraints\": { \"preserve_original_composition\": true, \"preserve_subject_structure\": true, \"no_face_alteration\": true, \"no_style_assumptions\": true, \"do_not_change_image_size\": true } }"
});
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: "{ \"image_type\": \"portrait_photography\", \"resolution_target\": \"8K UHD\", \"aspect_ratio\": \"vertical\", \"frame_composition\": { \"crop\": \"mid-chest to head\", \"orientation\": \"portrait\", \"subject_position\": \"centered\", \"camera_angle\": \"eye-level\", \"perspective\": \"straight-on\" }, \"subject\": { \"gender_presentation\": \"female\", \"age_appearance\": \"young adult\", \"face\": { \"shape\": \"oval\", \"skin_tone\": \"fair with neutral undertone\", \"skin_texture\": \"smooth, natural, visible realism, no heavy retouching\", \"facial_features\": { \"eyes\": { \"color\": \"light blue-green\", \"shape\": \"almond-shaped\", \"gaze_direction\": \"directly toward camera\", \"eyelids\": \"slightly relaxed\", \"eyelashes\": \"natural length, not exaggerated\" }, \"eyebrows\": { \"color\": \"dark brown\", \"thickness\": \"medium\", \"shape\": \"soft natural arch\" }, \"nose\": { \"shape\": \"straight\", \"size\": \"proportionate\", \"bridge\": \"smooth\" }, \"lips\": { \"color\": \"soft natural pink\", \"fullness\": \"medium to full\", \"state\": \"slightly parted\" } }, \"expression\": \"neutral, calm, composed\" }, \"hair\": { \"color\": \"dark brown\", \"length\": \"short to medium\", \"style\": \"loose, slightly wavy\", \"movement\": \"wind-blown strands crossing face\", \"parting\": \"natural, unstructured\" } }, \"clothing\": { \"outerwear\": { \"type\": \"coat\", \"color\": \"deep royal blue\", \"material_appearance\": \"wool or felt-like texture\", \"fit\": \"structured but relaxed\", \"visible_details\": \"clean seams, minimal design\" }, \"accessory\": { \"type\": \"scarf\", \"color\": \"matching royal blue\", \"material_appearance\": \"soft, fabric texture\", \"placement\": \"wrapped loosely around neck\" } }, \"color_palette\": { \"dominant_colors\": [ \"royal blue\", \"deep blue\", \"soft skin tones\" ], \"contrast\": \"high contrast between blue clothing and lighter skin\", \"color_temperature\": \"cool\" }, \"lighting\": { \"type\": \"natural light\", \"direction\": \"frontal with slight side softness\", \"intensity\": \"moderate\", \"shadows\": \"soft, minimal harsh shadows\", \"highlights\": \"subtle highlights on cheekbones and lips\" }, \"background\": { \"environment\": \"open outdoor setting\", \"elements\": \"blurred horizon line, blue gradient background\", \"depth_of_field\": \"shallow\", \"background_detail\": \"intentionally out of focus\", \"color\": \"blue gradient resembling sky and distant water\" }, \"image_style\": { \"realism\": \"high realism with subtle AI polish\", \"sharpness\": \"high facial detail\", \"texture_detail\": \"visible fabric texture and skin detail\", \"noise\": \"minimal\", \"post_processing\": \"clean color grading, no heavy filters\" }, \"mood\": { \"overall_feel\": \"calm, serene, minimalistic\", \"visual_energy\": \"soft and composed\" }, \"generation_constraints\": { \"preserve_original_composition\": true, \"preserve_subject_structure\": true, \"no_face_alteration\": true, \"no_style_assumptions\": true, \"do_not_change_image_size\": true } }"
)
puts result.id
复制
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader("{\"model\":\"gpt-image-2\",\"prompt\":\"{ \\\"image_type\\\": \\\"portrait_photography\\\", \\\"resolution_target\\\": \\\"8K UHD\\\", \\\"aspect_ratio\\\": \\\"vertical\\\", \\\"frame_composition\\\": { \\\"crop\\\": \\\"mid-chest to head\\\", \\\"orientation\\\": \\\"portrait\\\", \\\"subject_position\\\": \\\"centered\\\", \\\"camera_angle\\\": \\\"eye-level\\\", \\\"perspective\\\": \\\"straight-on\\\" }, \\\"subject\\\": { \\\"gender_presentation\\\": \\\"female\\\", \\\"age_appearance\\\": \\\"young adult\\\", \\\"face\\\": { \\\"shape\\\": \\\"oval\\\", \\\"skin_tone\\\": \\\"fair with neutral undertone\\\", \\\"skin_texture\\\": \\\"smooth, natural, visible realism, no heavy retouching\\\", \\\"facial_features\\\": { \\\"eyes\\\": { \\\"color\\\": \\\"light blue-green\\\", \\\"shape\\\": \\\"almond-shaped\\\", \\\"gaze_direction\\\": \\\"directly toward camera\\\", \\\"eyelids\\\": \\\"slightly relaxed\\\", \\\"eyelashes\\\": \\\"natural length, not exaggerated\\\" }, \\\"eyebrows\\\": { \\\"color\\\": \\\"dark brown\\\", \\\"thickness\\\": \\\"medium\\\", \\\"shape\\\": \\\"soft natural arch\\\" }, \\\"nose\\\": { \\\"shape\\\": \\\"straight\\\", \\\"size\\\": \\\"proportionate\\\", \\\"bridge\\\": \\\"smooth\\\" }, \\\"lips\\\": { \\\"color\\\": \\\"soft natural pink\\\", \\\"fullness\\\": \\\"medium to full\\\", \\\"state\\\": \\\"slightly parted\\\" } }, \\\"expression\\\": \\\"neutral, calm, composed\\\" }, \\\"hair\\\": { \\\"color\\\": \\\"dark brown\\\", \\\"length\\\": \\\"short to medium\\\", \\\"style\\\": \\\"loose, slightly wavy\\\", \\\"movement\\\": \\\"wind-blown strands crossing face\\\", \\\"parting\\\": \\\"natural, unstructured\\\" } }, \\\"clothing\\\": { \\\"outerwear\\\": { \\\"type\\\": \\\"coat\\\", \\\"color\\\": \\\"deep royal blue\\\", \\\"material_appearance\\\": \\\"wool or felt-like texture\\\", \\\"fit\\\": \\\"structured but relaxed\\\", \\\"visible_details\\\": \\\"clean seams, minimal design\\\" }, \\\"accessory\\\": { \\\"type\\\": \\\"scarf\\\", \\\"color\\\": \\\"matching royal blue\\\", \\\"material_appearance\\\": \\\"soft, fabric texture\\\", \\\"placement\\\": \\\"wrapped loosely around neck\\\" } }, \\\"color_palette\\\": { \\\"dominant_colors\\\": [ \\\"royal blue\\\", \\\"deep blue\\\", \\\"soft skin tones\\\" ], \\\"contrast\\\": \\\"high contrast between blue clothing and lighter skin\\\", \\\"color_temperature\\\": \\\"cool\\\" }, \\\"lighting\\\": { \\\"type\\\": \\\"natural light\\\", \\\"direction\\\": \\\"frontal with slight side softness\\\", \\\"intensity\\\": \\\"moderate\\\", \\\"shadows\\\": \\\"soft, minimal harsh shadows\\\", \\\"highlights\\\": \\\"subtle highlights on cheekbones and lips\\\" }, \\\"background\\\": { \\\"environment\\\": \\\"open outdoor setting\\\", \\\"elements\\\": \\\"blurred horizon line, blue gradient background\\\", \\\"depth_of_field\\\": \\\"shallow\\\", \\\"background_detail\\\": \\\"intentionally out of focus\\\", \\\"color\\\": \\\"blue gradient resembling sky and distant water\\\" }, \\\"image_style\\\": { \\\"realism\\\": \\\"high realism with subtle AI polish\\\", \\\"sharpness\\\": \\\"high facial detail\\\", \\\"texture_detail\\\": \\\"visible fabric texture and skin detail\\\", \\\"noise\\\": \\\"minimal\\\", \\\"post_processing\\\": \\\"clean color grading, no heavy filters\\\" }, \\\"mood\\\": { \\\"overall_feel\\\": \\\"calm, serene, minimalistic\\\", \\\"visual_energy\\\": \\\"soft and composed\\\" }, \\\"generation_constraints\\\": { \\\"preserve_original_composition\\\": true, \\\"preserve_subject_structure\\\": true, \\\"no_face_alteration\\\": true, \\\"no_style_assumptions\\\": true, \\\"do_not_change_image_size\\\": true } }\"}")
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)
}