$npx -y skills add OpsinTech/opsintech-platform --skill image-generationUse this skill when the user requests to generate, create, imagine, or visualize images including characters, scenes, products, or any visual content. Supports structured prompts and reference images for guided generation.
| 1 | # Image Generation Skill |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This skill generates high-quality images using structured prompts and a Python script. The workflow includes creating JSON-formatted prompts and executing image generation with optional reference images. |
| 6 | |
| 7 | ## Core Capabilities |
| 8 | |
| 9 | - Create structured JSON prompts for AIGC image generation |
| 10 | - Support multiple reference images for style/composition guidance |
| 11 | - Generate images through automated Python script execution |
| 12 | - Handle various image generation scenarios (character design, scenes, products, etc.) |
| 13 | |
| 14 | ## Workflow |
| 15 | |
| 16 | ### Step 1: Understand Requirements |
| 17 | |
| 18 | When a user requests image generation, identify: |
| 19 | |
| 20 | - Subject/content: What should be in the image |
| 21 | - Style preferences: Art style, mood, color palette |
| 22 | - Technical specs: Aspect ratio, composition, lighting |
| 23 | - Reference images: Any images to guide generation |
| 24 | - You don't need to check the folder under `/mnt/user-data` |
| 25 | |
| 26 | ### Step 2: Create Structured Prompt |
| 27 | |
| 28 | Generate a structured JSON file in `/mnt/user-data/workspace/` with naming pattern: `{descriptive-name}.json` |
| 29 | |
| 30 | ### Step 3: Execute Generation |
| 31 | |
| 32 | Call the Python script: |
| 33 | ```bash |
| 34 | python /mnt/skills/public/image-generation/scripts/generate.py \ |
| 35 | --prompt-file /mnt/user-data/workspace/prompt-file.json \ |
| 36 | --reference-images /path/to/ref1.jpg /path/to/ref2.png \ |
| 37 | --output-file /mnt/user-data/outputs/generated-image.jpg |
| 38 | --aspect-ratio 16:9 |
| 39 | ``` |
| 40 | |
| 41 | Parameters: |
| 42 | |
| 43 | - `--prompt-file`: Absolute path to JSON prompt file (required) |
| 44 | - `--reference-images`: Absolute paths to reference images (optional, space-separated) |
| 45 | - `--output-file`: Absolute path to output image file (required) |
| 46 | - `--aspect-ratio`: Aspect ratio of the generated image (optional, default: 16:9) |
| 47 | |
| 48 | [!NOTE] |
| 49 | Do NOT read the python file, just call it with the parameters. |
| 50 | |
| 51 | ## Character Generation Example |
| 52 | |
| 53 | User request: "Create a Tokyo street style woman character in 1990s" |
| 54 | |
| 55 | Create prompt file: `/mnt/user-data/workspace/asian-woman.json` |
| 56 | ```json |
| 57 | { |
| 58 | "characters": [{ |
| 59 | "gender": "female", |
| 60 | "age": "mid-20s", |
| 61 | "ethnicity": "Japanese", |
| 62 | "body_type": "slender, elegant", |
| 63 | "facial_features": "delicate features, expressive eyes, subtle makeup with emphasis on lips, long dark hair partially wet from rain", |
| 64 | "clothing": "stylish trench coat, designer handbag, high heels, contemporary Tokyo street fashion", |
| 65 | "accessories": "minimal jewelry, statement earrings, leather handbag", |
| 66 | "era": "1990s" |
| 67 | }], |
| 68 | "negative_prompt": "blurry face, deformed, low quality, overly sharp digital look, oversaturated colors, artificial lighting, studio setting, posed, selfie angle", |
| 69 | "style": "Leica M11 street photography aesthetic, film-like rendering, natural color palette with slight warmth, bokeh background blur, analog photography feel", |
| 70 | "composition": "medium shot, rule of thirds, subject slightly off-center, environmental context of Tokyo street visible, shallow depth of field isolating subject", |
| 71 | "lighting": "neon lights from signs and storefronts, wet pavement reflections, soft ambient city glow, natural street lighting, rim lighting from background neons", |
| 72 | "color_palette": "muted naturalistic tones, warm skin tones, cool blue and magenta neon accents, desaturated compared to digital photography, film grain texture" |
| 73 | } |
| 74 | ``` |
| 75 | |
| 76 | Execute generation: |
| 77 | ```bash |
| 78 | python /mnt/skills/public/image-generation/scripts/generate.py \ |
| 79 | --prompt-file /mnt/user-data/workspace/cyberpunk-hacker.json \ |
| 80 | --output-file /mnt/user-data/outputs/cyberpunk-hacker-01.jpg \ |
| 81 | --aspect-ratio 2:3 |
| 82 | ``` |
| 83 | |
| 84 | With reference images: |
| 85 | ```json |
| 86 | { |
| 87 | "characters": [{ |
| 88 | "gender": "based on [Image 1]", |
| 89 | "age": "based on [Image 1]", |
| 90 | "ethnicity": "human from [Image 1] adapted to Star Wars universe", |
| 91 | "body_type": "based on [Image 1]", |
| 92 | "facial_features": "matching [Image 1] with slight weathered look from space travel", |
| 93 | "clothing": "Star Wars style outfit - worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with holster", |
| 94 | "accessories": "blaster pistol on hip, comlink device on wrist, goggles pushed up on forehead, satchel with supplies, personal vehicle based on [Image 2]", |
| 95 | "era": "Star Wars universe, post-Empire era" |
| 96 | }], |
| 97 | "prompt": "Character inspired by [Image 1] standing next to a vehicle inspired by [Image 2] on a bustling alien planet street in Star Wars universe aesthetic. Character wearing worn leather jacket with utility vest, cargo pants with tactical pouches, scuffed boots, belt with blaster holster. The vehicle adapted to Star Wars aesthetic with weathered metal panels, repulsor engines, desert dust covering, parked on the street. Exotic alien marketplace street with multi-level architecture, weathered metal structures, hanging market stal |