Codex Image Generator (codex-imggen) for Openclaw

An advanced Openclaw Skills extension leveraging the Codex CLI to generate single or batched, size-controlled images and game assets with proxy support.

axelhu
v1.1.1
Jun 8, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install codex-imggen

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 codex-imggen 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 Codex Image Generator (codex-imggen)?

The codex-imggen tool is a highly specialized skill built to extend the capabilities of AI agents in the Openclaw Skills repository. By interfacing directly with the Codex CLI (via npm), it empowers developers and designers to automate image generation with absolute control over dimensions, styles, and batches. This skill addresses a critical challenge in developer workflows: programmatically requesting, creating, and staging high-fidelity graphics straight from terminal environments.

Optimized for reliability and workflow precision, the skill includes built-in proxy defaults for unrestricted connectivity and custom timeout tolerance to prevent premature runner failures. It translates plain text instructions into layout-safe, professional art, acting as a crucial bridge between automated agent logic and digital content generation pipelines.

Codex Image Generator (codex-imggen) Use Cases

  • Game UI & Icon Asset Creation: Batch generate up to six game assets (RPG potions, cyberpunk items, minimal buttons, pixel art) in single grid-sheets to minimize latency.
  • Exact Size Prototyping: Generate web mockups, vertical mobile backgrounds, or square illustrations using safe aspect ratios to completely bypass unwanted scaling degradation.
  • Style-Transfer Workflows: Supply a local reference image with the -i parameter to instruct Codex to mimic a specific art style, color theme, or brand perspective.
  • Automated AI Design Loops: Set up coding agents to run visual verification checks on the output image and run automatic correction scripts on visual mismatches.

How Codex Image Generator (codex-imggen) Works

  1. Shell Script Execution: The user or AI agent executes one of the three core bash controllers: generate.sh (single prompt), gen_size.sh (specific aspect ratios), or batch_generate.sh (grid-based multi-prompt generation).
  2. Network Routing & Proxy Verification: The script checks the configured network parameters, applying the default proxy settings (http://127.0.0.1:1080) to ensure a stable handshake with the generation servers.
  3. Dimension Classification: Based on the requested size key (e.g., 1K, 1536x1024, 9:16), the script matches the request to one of the 8 predefined aspect buckets inside the ~1.57MP physical limit.
  4. Context Processing: If a reference image is passed via the -i flag, it is attached as context for style transfer and color scheme mapping.
  5. Caching & Retrieval: The generated graphics are written to the permanent cache folder under ~/.codex/generated_images/ and a copy is immediately mirrored to the user-defined output folder.

Codex Image Generator (codex-imggen) Setup

Prerequisites

Ensure that you have the global codex npm package installed on your system, as this skill acts as a shell wrapper around it:

npm install -g codex

Installation & Configuration

  1. Mark all utility scripts within the codex-imggen directory as executable:
chmod +x ~/.openclaw/skills/codex-imggen/scripts/*.sh
  1. By default, the scripts route API requests through a local proxy at http://127.0.0.1:1080. If you use a different proxy setup, open the script files and edit the PROXY variable at the head of the files:
# Inside scripts/generate.sh, scripts/gen_size.sh, or scripts/batch_generate.sh
PROXY="http://your-custom-proxy:port"
  1. Since image generation requires remote computation, set your AI agent execution timeout to at least 180 seconds to avoid early task termination during high-traffic windows.

Codex Image Generator (codex-imggen) Data Schema & Taxonomy

Output Directories and File Assets

All generated outputs are cataloged systematically in both the local project folders and a persistent user directory cache:

Directory Location Data Type / Content Description
~/.codex/generated_images/<session-id>/ Original Source Images Stores all raw generation outputs matching the server's processed output grid.
[output_dir]/ (Optional) User-Selected Mirror Mirrored outputs copied from cache to the developer's requested directory path.

Size Bucket Taxonomy

To prevent serious resolution compression, the skill maps commands to specific predefined resolution configurations:

  • Square Assets (1K / 1:1 / square): Resolves strictly to 1254x1254 (No scaling degradation, ideal for individual icons).
  • Standard Landscape (1536x1024): Resolves strictly to 1536x1024 (Perfect accuracy, standard landscape target).
  • Widescreen Medium (2K / 16:9 / FHD): Downgrades to 1672x941 to conform to maximum aspect buckets.
  • Cinematic / Wide Ratio (2048x1080): Resolves to 1727x911 (optimal match for wide mockups).
  • Portrait Format (9:16): Resolves perfectly to 941x1672 (best for mobile interfaces).
  • Classic Format (4:3): Resolves to 1448x1086.

Codex Image Generator (codex-imggen) Advanced Features

  • Grid Splicing Integration: Designed to work alongside other Openclaw Skills (such as sprite-tools), allowing agents to pass batch-generated grids (e.g., a 3x2 grid of 6 items) to batch_split.sh to extract transparent, standalone PNG sprites automatically.
  • Multi-Asset Reference Injector: Pass previous generation outputs with -i to construct sequential UI elements with consistent thematic colors and matching backgrounds.
  • Self-Correcting Visual Validation Loops: Ideal for vision-equipped LLMs to inspect the resulting assets using image analysis tools, automatically triggering generation retries upon server-side anomalies or style deviation.
  • Proxy Bypass Controls: Easily customized bash templates allowing seamless transition between sandboxed offline runs and live proxy routing environments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Github Stars: 0
forks: 0

Featured*