본문으로 건너뛰기
cccskills
무료GitHub에 공개

gpt-image2

Generate and edit images with Dreamfield's OpenAI-compatible gpt-image-2 image API. Use when the user asks Codex to create, test, or save an image from a text description, make wallpaper or illustration assets, perform image-to-image generation from reference images or clipboard images, use masks/inpainting, verify Dreamfield image generation, or troubleshoot image-generation responses such as empty data, b64_json, URL output, quota errors, or content policy errors.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구OpenAI
설치 방법 보기

포함된 파일(7)

  • SKILL.md3.6 KB
  • agents/openai.yaml273 B
  • references/cli.md2.2 KB
  • references/mask.md2.1 KB
  • references/troubleshooting.md1.3 KB
  • scripts/generate_image2.py48.9 KB
  • scripts/mask_painter.py11.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

GPT Image 2

Use Dreamfield's OpenAI-compatible image endpoints:

POST https://www.dreamfield.top/v1/images/generations
POST https://www.dreamfield.top/v1/images/edits

Recommended environment:

  • Provider: Dreamfield, https://www.dreamfield.top/
  • Model: gpt-image-2
  • API key env var: NEW_image2_API_KEY
  • Author usage note: this skill has been tested with Dreamfield for personal use. It supports 4K output. For details, check Dreamfield for current pricing and model limits.

Use scripts/generate_image2.py for all calls. It handles text-to-image, image-to-image, clipboard images, input preprocessing, mask normalization/generation, manual mask drawing, mask overlay previews, conservative retry, response saving, multi-image output, target resizing, and summary.json indexing.

Workflow

  1. Convert the user's request to a concise English prompt. Include practical constraints such as no text and no watermark.
  2. Use text-to-image when there is no usable local or clipboard image.
  3. Use image-to-image when the user provides --image, asks to use a reference image, or asks for image-to-image.
  4. Use --clipboard-image when the user copied an image to the OS clipboard.
  5. Use mask editing only for localized edits/inpainting; otherwise omit mask parameters. Use --mask-draw when the user needs to manually paint or circle the edit area.
  6. Prefer response_format=b64_json for deterministic local PNG saving.
  7. Show final local image paths and summary paths.

Common Commands

Text-to-image:

SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/gpt-image2"
python3 "$SKILL_DIR/scripts/generate_image2.py" \
  --prompt "A cinematic 16:9 desktop wallpaper of golden lightning over green hills at sunset, no text, no watermark." \
  --size 1792x1024

Image-to-image:

SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/gpt-image2"
python3 "$SKILL_DIR/scripts/generate_image2.py" \
  --image "/absolute/path/to/reference.png" \
  --prompt "Create a new photorealistic 16:9 wallpaper inspired by this reference image, no text, no watermark." \
  --size 1792x1024

Masked edit:

SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/gpt-image2"
python3 "$SKILL_DIR/scripts/generate_image2.py" \
  --image "/absolute/path/to/source.png" \
  --mask-auto rect \
  --mask-rect 120,80,640,360 \
  --prompt "Replace only the masked area while preserving the rest of the image. No text, no watermark." \
  --size 1792x1024

Manual masked edit:

SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/gpt-image2"
python3 "$SKILL_DIR/scripts/generate_image2.py" \
  --image "/absolute/path/to/source.png" \
  --mask-draw \
  --prompt "Replace only the painted area while preserving the rest of the image. No text, no watermark." \
  --size 1792x1024

Self-test:

SKILL_DIR="${CODEX_HOME:-$HOME/.codex}/skills/gpt-image2"
python3 "$SKILL_DIR/scripts/generate_image2.py" --self-test

References

  • Full CLI parameters: references/cli.md
  • Mask semantics and examples: references/mask.md
  • Self-test, retry, and troubleshooting: references/troubleshooting.md

Load the relevant reference file only when the user needs those details.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

이 스킬의 문제 신고