← 返回
未分类 Key

OpenAI-HK-Image-2

HK gpt-image-2 image generation via OpenAI-HK API. Use for: hk生成图片, hk画图, hk文生图, hk图生图, gpt画图, GPT图片, or any hk image generation request.
HK gpt-image-2 image generation via OpenAI-HK API. Use for: hk生成图片, hk画图, hk文生图, hk图生图, gpt画图, GPT图片, or any hk image generation request.
swoole
未分类 community v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 78
下载
💾 0
安装
1
版本
#latest

概述

GPT-Image-2 Image Generation (OpenAI-HK)

API Configuration

  • Base URL: https://api.openai-hk.com
  • Auth: Bearer hk-{API_KEY}
  • Endpoints:
  • Text-to-image: POST /v1/images/generations
  • Image-to-image: POST /v1/images/edits

Quick Start

# Text-to-image
curl https://api.openai-hk.com/v1/images/generations \
  -H "Authorization: Bearer hk-$API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "your prompt",
    "n": 1,
    "size": "1024x1024",
    "quality": "low"
  }'

Available Models

ModelDescription
--------------------
gpt-image-2Latest GPT image generation v2
gpt-image-1.5Previous version
gpt-image-1Original GPT image

Quality Options

QualityDescriptionApprox Cost
------------------------------------
lowFast, ~800 credits (1024x1024)800 积分
mediumBalanced, ~3000 credits3000 积分
highMaximum qualityHigher
autoModel decides (default)-

Size Options

Square

  • 1024x1024 (1K)
  • 2048x2048 (2K)
  • 2880x2880 (4K)

Widescreen 16:9

  • 1280x720 (1K)
  • 2048x1152 (2K)
  • 3840x2160 (4K)

Story 9:16

  • 720x1280 (1K)
  • 1152x2048 (2K)
  • 2160x3840 (4K)

Other Ratios

  • 5:4, 4:5, 4:3, 3:4, 3:2, 2:3, 21:9

Image Generation Script

# Text-to-image
python3 /root/.openclaw/workspace/skills/hk-gpt-image-2/scripts/generate_image.py \
  --api-key "hk-xxx" \
  --prompt "一只可爱的橘猫" \
  --model gpt-image-2 \
  --size 1024x1024 \
  --quality low \
  --output "/root/.openclaw/media/images/$(date +%Y-%m-%d)-$RANDOM.png"

# Image-to-image (edit)
python3 /root/.openclaw/workspace/skills/hk-gpt-image-2/scripts/generate_image.py \
  --api-key "hk-xxx" \
  --prompt "把这只猫变成蓝色" \
  --input-image /path/to/cat.png \
  --output "/root/.openclaw/media/images/$(date +%Y-%m-%d)-$RANDOM.png"

Workflows

Text-to-Image (文生图)

  1. User provides prompt
  2. Choose model (default: gpt-image-2), size (default: 1024x1024), quality (default: low)
  3. Call /v1/images/generations
  4. Download and save image to /root/.openclaw/media/images/
  5. Deliver to user

Image-to-Image (图生图)

  1. User provides reference image(s) and prompt
  2. Call /v1/images/edits with multipart form
  3. Download and save result
  4. Deliver to user

Notes

  • Default output directory: /root/.openclaw/media/images/
  • Filename format: YYYY-MM-DD-RANDOM.png
  • Max reference images for edit: Multiple (no strict limit)
  • For best quality, use quality: high but costs more credits
  • Response format supports both url (default) and b64_json

版本历史

共 1 个版本

  • v1.0.0 Initial release 当前
    2026-05-05 16:26 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

Video Frames

steipete
使用 ffmpeg 从视频中提取帧或短片。
★ 134 📥 52,875
design-media

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 430 📥 116,951
design-media

Openai Whisper

steipete
使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)
★ 331 📥 93,813