ima2-gen AGENTS.md

ima2-gen AGENTS.md is an instructions file for Codex, OpenCode from lidge-jun/ima2-gen. It costs 1,235 tokens per session, scanned A, original, MIT.

Project instructions for ima2-gen, a local image-generation studio with a command-line tool and web interface. They describe its supported providers, technology stack, file layout, and server design.

In plain words
What is it for?
Use them to find the relevant server routes, image and video generation code, user-interface files, configuration, and event-streaming code.
Why use it?
They give coding agents enough context to work safely in a project that can create or edit images and generate videos through several services.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/lidge-jun/ima2-gen/agents-md
Clone the repo
git clone --depth 1 https://github.com/lidge-jun/ima2-gen

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ima2-gen AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lidge-jun/ima2-gen/agents-md.svg)](https://agentmods.dev/instructions/lidge-jun/ima2-gen/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/lidge-jun/ima2-gen/agents-md"><img src="https://agentmods.dev/badge/instructions/lidge-jun/ima2-gen/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,235 This file is loaded in full into every session.
When invoked 1,235 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01235 $0.01235
Opus 5 $0.00617 $0.00617
Sonnet 5 $0.00247 $0.00247
Haiku 4.5 $0.00123 $0.00123

Measured 4d ago against content hash 672c0f5a08c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ima2-gen AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ima2-gen — AI Context

What This Project Does

Local image generation studio (v2.x) — CLI + 웹 UI

  • GPT OAuth, API Key, Grok, Gemini API, Antigravity CLI 다중 provider 지원
  • 텍스트→이미지, 이미지→이미지(편집), 비디오 생성
  • SSE 멀티플렉싱: 단일 GET /api/events SSE 채널 + async POST (202) 아키텍처
  • 병렬 생성 (최대 12건, 브라우저 연결 포화 없음)

Tech Stack

  • Runtime: Node.js >=20 (ES Module)
  • Server: Express 5
  • API Client: OpenAI SDK v5
  • OAuth: openai-oauth (ChatGPT 세션 프록시)
  • Grok: bundled progrok (xAI Images API)
  • Gemini: Google Generative Language API / Vertex AI
  • Frontend: React + Vite (ui/src, built to ui/dist)
  • SSE: lib/eventBus.ts (ring buffer pub/sub) + routes/events.ts

Project Structure

ima2-gen/
├── bin/                  # CLI entry + subcommands
├── server.ts             # Express bootstrap / static UI serving
├── config.ts             # Runtime config
├── routes/               # API route modules (*.ts source)
│   ├── events.ts         # GET /api/events SSE multiplexing
│   ├── multimode.ts      # Multimode batch (async POST + dual-emit)
│   ├── nodes.ts          # Node mode (async POST + dual-emit)
│   ├── video.ts          # Video generation (async POST + dual-emit)
│   └── ...               # generate, edit, sessions, history, etc.
├── lib/                  # Server helpers (*.ts source)
│   ├── eventBus.ts       # Global pub/sub ring buffer (2000 events)
│   ├── ssePublish.ts     # Cancel-done race guard
│   ├── inflight.ts       # Job lifecycle tracking
│   └── ...               # OAuth, storage, sessions, etc.
├── ui/src/               # React/Vite app source
│   ├── lib/eventChannel.ts  # Singleton EventSource for /api/events
│   ├── lib/sseStreamError.ts # SSE error parser
│   └── store/store*Impl.ts  # Modular Zustand slices
├── ui/dist/              # Built frontend served by server.js
├── site/                 # Astro marketing/docs site (GitHub Pages)
├── integrations/comfyui/ # ComfyUI bridge/custom node
├── structure/            # Current architecture reference docs (00-07)
├── devlog/               # _plan (active), _fin (archived)
├── tests/                # node:test contracts/regressions (1094 cases)
└── package.json

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 101 lines · 1,235 tokens per session scan A 672c0f5a08c9

Subscribe to this mod's changes

ima2-gen AGENTS.md is an instructions file published in the GitHub repository lidge-jun/ima2-gen (722 stars, last pushed 4d ago), licensed MIT. It adds 1,235 tokens to every session, about $0.0062 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.