SudoCode GPT Image 2 Generator for Openclaw

An AI-powered image generation and editing skill running on Node.js and Python, driven by the official SudoCode GPT Image 2 model for high-fidelity 4K visual assets.

shengy983
v1.0.0
May 20, 2026
0
712
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install sudocode-gpt-image-2-gen

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install sudocode-gpt-image-2-gen using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is SudoCode GPT Image 2 Generator?

The SudoCode GPT Image 2 Generator is a robust and flexible visual asset creation tool designed to integrate seamlessly into developer and AI agent workflows. Operating through the official SudoCode platform, this skill leverages the state-of-the-art gpt-image-2 model to produce highly accurate images, visual infographics, and complex modifications of existing images using natural language instructions. By selecting this skill from the Openclaw Skills directory, developers can leverage programmatic control over pixel dimensions, file formats, compression ratios, and rendering quality.

Unlike traditional wrapper solutions, this skill accesses the official SudoCode endpoints directly, offering a token-based billing structure and full programmatic consistency. It features zero-dependency execution for Node.js environments and a robust fall-back execution model for Python-based environments, making it exceptionally reliable across diverse staging and production systems.

SudoCode GPT Image 2 Generator Use Cases

  • High-Fidelity Text-to-Image Generation: Automatically generate customized branding, social media posts, or technical diagrams using direct natural language prompts.
  • Complex Image Editing (Image-to-Image): Apply localized edits, replace backgrounds, or introduce new visual elements (like adding a rainbow to a landscape) using precise, instruction-driven edits.
  • Multi-Image Merging & Fusion: Blend up to 5 reference images together, allowing AI agents to merge the subject of one photo with the stylistic background of another.
  • Custom Wallpaper and Asset Creation: Produce high-definition 4K desktop (16:9) or mobile (9:16) wallpapers with granular quality adjustments.

How SudoCode GPT Image 2 Generator Works

  1. Intent and Parameter Parsing: The skill receives natural language instructions, analyzes user intent, and maps the request to text-to-image (generations) or image-to-image (edits) pipelines.
  2. Prompt Enrichment: It captures the user's raw input prompt to preserve semantic nuances, dynamically prompting the user for confirmation before appending style details.
  3. Environment and Auth Check: The script automatically verifies authentication via the SUDOCODE_API_KEY environment variable or command-line overrides.
  4. API Endpoint Dispatch: It sends a structured payload to SudoCode's /v1/images/generations (JSON) or /v1/images/edits (multipart/form-data for reference images) endpoint.
  5. Long-Running Process Feedback: Because rendering high-quality assets (such as 4K high-quality outputs) takes 120-150 seconds, the skill prints clear terminal progress updates.
  6. Asset Decoding and Disk Storage: Once the base64 payload (b64_json) is returned, the engine strips headers, decodes the raw base64 data, and safely saves the resulting file (PNG, JPEG, or WebP) to the designated output folder.

SudoCode GPT Image 2 Generator Setup

1. Acquire Your API Key

Visit SudoCode, sign up or log in, and generate your API Key from the developer console.

2. Configure Environment Variables

Set your API key using your platform's environment variables to authenticate with Openclaw Skills automatically:

# Linux or macOS
export SUDOCODE_API_KEY="your_actual_api_key_here"

# Windows CMD
set SUDOCODE_API_KEY="your_actual_api_key_here"

# Windows PowerShell
$env:SUDOCODE_API_KEY="your_actual_api_key_here"

3. Execution Options

This skill supports zero-dependency Node.js execution (recommended) and Python scripts. Openclaw Skills will choose the best runtime dynamically:

# Using Node.js (Recommended/Default)
node scripts/generate_image.js -p "A cute orange tabby cat playing on green grass" -f "cat.png"

# Using Python
python scripts/generate_image.py -p "A cute orange tabby cat playing on green grass" -f "cat.png"

SudoCode GPT Image 2 Generator Data Schema & Taxonomy

The skill processes structured parameters and writes outputs directly to disk. The base64 output (b64_json) returned from the SudoCode API contains no prefix (i.e., pure base64 data), which is handled automatically by the scripts.

Parameter Schema Reference

CLI Flag Short/Long Name Required Description Default / Values
-p --prompt Yes Natural language prompt or editing instruction User raw input
-f --filename No Target output file name (saves automatically with timestamp if omitted) Auto-generated
-s --size No Image resolution. Presets include: 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 3840x2160, 2160x3840 auto (Custom values allowed under 3840 max edge, divisible by 16, ratio <= 3:1)
-q --quality No Render quality profiles auto, low, medium, high
-o --output-format No Target extension png, jpeg, webp
-c --output-compression No Compression factor (0-100) for JPEG and WebP 100
-i --input-image No Paths to input reference images (up to 5) for image-to-image mode None

Image Dimension Specifications

Preset Dimensions Aspect Ratio Primary Use Case
1024x1024 1:1 Avatars, social icons, Instagram posts
1536x1024 3:2 Landscape photography, default landscape
1024x1536 2:3 Standard portrait photography
2048x2048 1:1 High-definition square illustrations
2048x1152 16:9 HD video covers, widescreen presentations, desktop wallpapers
3840x2160 16:9 4K Ultra HD landscape wallpapers
2160x3840 9:16 4K Mobile portrait wallpapers

SudoCode GPT Image 2 Generator Advanced Features

  • Advanced Zero-Dependency Node.js Support: Executes quickly on native Node runtimes without having to manage heavy third-party packages, optimizing CI/CD runtimes.
  • Explicit Precision Controls: Direct control over image sizing, compression rates, and fine quality tiers, outperforming reverse-engineered web interfaces.
  • Robust Multi-Image Fusion: Combines up to 5 reference images simultaneously via multipart/form-data upload. The order of references can be targeted sequentially in prompts using terms like 'Image 1' and 'Image 2'.
  • Intelligent Prompt Handling: Protects prompt integrity by using the user's explicit raw instructions, ensuring no loss of user-specified detail before execution.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*