Agent skill

Luma Imagegen

by davila7 in davila7/claude-code-templates

A skill your agent uses when the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively, then calls the API using the bundled script.

MITAuto-check: notesMedia & Creative

Install Luma Imagegen

skills CLI
$ npx skills add davila7/claude-code-templates --skill luma-imagegen -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates luma-imagegen --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/creative-design/luma-imagegen .claude/skills/luma-imagegen && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
luma-imagegen
GitHub stars
33k
Token cost
~1.7k tokens
SKILL.md length
645 words
Files
2 (incl. scripts)
Skills in repo
479
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively, then calls the API using the bundled script.

  • Works in 7 steps: Check API key — detect LUMA_API_KEY in… → Collect inputs — ask the user for:… → Build the structured prompt — augment… → …
  • The user asks to generate images via the Luma AI API (Dream Machine / Photon)
  • SKILL.md covers When to use, Workflow, API key detection & setup and Interactive questions to ask…, plus 7 more sections
  • Runs Python scripts from its folder; calls python3; needs LUMA_API_KEY

What it does

Luma Imagegen is an agent skill from davila7/claude-code-templates. Use when the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively, then calls the API using the bundled script. Requires LUMAAPIKEY — will prompt the user if missing.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/luma_imagegen.py`).

It sits in Media & Creative, covering Image generation. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • The user asks to generate images via the Luma AI API (Dream Machine / Photon)
  • Collects a prompt and options interactively
  • Then calls the API using the bundled script

Example prompts

  • “/luma-imagegen”

Requirements

  • Python 3
  • A credential in LUMA_API_KEY

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Check API key — detect LUMA_API_KEY in environment. If missing, guide the user (see below).
  2. Collect inputs — ask the user for: prompt, aspect ratio, model choice, and any optional reference images.
  3. Build the structured prompt — augment the user's description into a labeled spec (see prompt template below).
  4. Run the bundled CLI — execute scripts/luma_imagegen.py with the collected parameters.
  5. Poll until complete — the script handles async polling automatically; wait for state: completed.
  6. Display result — show the final image URL and download the image to output/luma/.
  7. Iterate — if the result doesn't match expectations, adjust the prompt and re-run.

What it can do on your machine

Read from SKILL.md and the folder at commit c0ca7da. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • lumalabs.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • LUMA_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Luma Imagegen loads about 1.7k tokens when it runs. Until then it costs about 62 tokens; SKILL.md has 645 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~62
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:37
    3. Ask them to add it to their `.env` file or export it in their shell:

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit c0ca7da, republished under its MIT licence (© davila7). 645 words, ~1,669 tokens.

Download SKILL.mdSave it as .claude/skills/luma-imagegen/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
luma-imagegen
description
Use when the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively, then calls the API using the bundled script. Requires LUMA_API_KEY — will prompt the user if missing.
author
lumalabs

Luma Image Generation Skill

Generates images using the Luma AI Photon model (Dream Machine API). Handles API key detection, interactive prompt collection, parameter selection, async polling, and final image download — all via the bundled scripts/luma_imagegen.py CLI.

When to use

  • Generate a new image from a text description using Luma AI (Photon / Photon Flash)
  • Use a reference image to guide style, structure, or character consistency
  • Modify or stylize an existing image using Luma's modify_image_ref

Workflow

  1. Check API key — detect LUMA_API_KEY in environment. If missing, guide the user (see below).
  2. Collect inputs — ask the user for: prompt, aspect ratio, model choice, and any optional reference images.
  3. Build the structured prompt — augment the user's description into a labeled spec (see prompt template below).
  4. Run the bundled CLI — execute scripts/luma_imagegen.py with the collected parameters.
  5. Poll until complete — the script handles async polling automatically; wait for state: completed.
  6. Display result — show the final image URL and download the image to output/luma/.
  7. Iterate — if the result doesn't match expectations, adjust the prompt and re-run.

API key detection & setup

Before any API call, check for the key:

bash
python3 ${CLAUDE_SKILL_DIR}/scripts/luma_imagegen.py --check-key

If LUMA_API_KEY is missing:

  1. Tell the user the key is not set.
  2. Direct them to generate one: https://lumalabs.ai/dream-machine/api/keys
  3. Ask them to add it to their .env file or export it in their shell:
    bash
    export LUMA_API_KEY=your_key_here
  4. Never ask the user to paste the key in chat. Ask them to set it locally and confirm when ready.
  5. Once confirmed, retry the --check-key command to verify.

Interactive questions to ask the user

Ask these questions before running the generation:

  1. Prompt (required): "What image do you want to generate? Describe the scene, subject, style, and any important details."
  2. Aspect ratio (optional, default 16:9): "What aspect ratio? Options: 1:1, 3:4, 4:3, 9:16, 16:9 (default), 9:21, 21:9"
  3. Model (optional, default photon-1): "Use photon-1 (higher quality) or photon-flash-1 (faster and cheaper)?"
  4. Reference image (optional): "Do you have a reference image URL for style or structure guidance?"

Only ask what's needed — skip questions the user has already answered in their message.

Running the CLI

bash
python3 ${CLAUDE_SKILL_DIR}/scripts/luma_imagegen.py \
  --prompt "YOUR AUGMENTED PROMPT" \
  --aspect-ratio 16:9 \
  --model photon-1 \
  [--image-ref "https://example.com/ref.jpg" --image-ref-weight 0.85] \
  [--out output/luma/]

All flags:

FlagDefaultDescription
--prompt(required)Text description of the image
--aspect-ratio16:91:1, 3:4, 4:3, 9:16, 16:9, 9:21, 21:9
--modelphoton-1photon-1 or photon-flash-1
--image-ref—Public URL for style/structure reference
--image-ref-weight0.85Weight of reference image (0.0–1.0)
--modify-ref—Base image URL to modify
--modify-ref-weight0.5Weight for modification fidelity
--outoutput/luma/Output directory for downloaded images
--poll-interval3Seconds between polling requests
--check-key—Verify LUMA_API_KEY is set and exit
Show full SKILL.md (224 more words)Show less

Output conventions

  • Save final images to output/luma/ with descriptive filenames (e.g., photon1_hero_16x9.png). The output directory is relative to the current working directory when the script is invoked.
  • Log the generation ID for reference (useful to retrieve the image later).
  • If the generation fails, show the failure_reason from the API response.

Prompt augmentation

Reformat the user's description into a structured spec. Only make implied details explicit — do not invent new requirements.

Template (include only relevant lines):

Primary request: <user's main prompt>
Scene/background: <environment or setting>
Subject: <main subject>
Style/medium: <photo/illustration/3D/cinematic/etc>
Composition/framing: <wide/close-up/overhead; subject placement>
Lighting/mood: <lighting type and emotional tone>
Color palette: <dominant colors or palette notes>
Aspect ratio: <e.g., 16:9 landscape>
Avoid: <elements to exclude>

Augmentation rules:

  • Keep it concise — add only what the user implied or provided.
  • Always include "Avoid:" to prevent common quality issues (watermarks, logos, blur).
  • For modification requests, explicitly list what should change and what must stay the same.

Example augmented prompts

Landscape hero image
Primary request: a misty mountain lake at sunrise
Scene/background: alpine lake surrounded by pine trees, light morning fog
Style/medium: photorealistic nature photography
Composition/framing: wide panoramic, lake centered, mountains in background
Lighting/mood: golden hour, warm and serene
Aspect ratio: 16:9 landscape
Avoid: people, boats, watermarks, oversaturation
Product shot
Primary request: a ceramic coffee mug on a wooden table
Scene/background: warm kitchen interior, soft bokeh background
Subject: minimalist white ceramic mug, steam rising
Style/medium: clean product photography
Lighting/mood: soft diffused window light
Aspect ratio: 1:1 square
Avoid: text, logos, harsh shadows, clutter

Prompting best practices

  • Describe scene → subject → style → composition → lighting.
  • Mention the intended use (hero image, social post, product shot) to calibrate detail level.
  • Use "Avoid:" to eliminate common defects (watermarks, blur, stock-photo clichés).
  • For modifications, list invariants explicitly ("change only the background; keep the mug unchanged").
  • Start with photon-flash-1 for quick iteration; switch to photon-1 for final quality.
  • If the result isn't satisfactory, make one targeted change per iteration.

Models reference

ModelSpeedQualityBest for
photon-1SlowerHigherFinal assets, complex scenes
photon-flash-1FastGoodRapid iteration, drafts

Dependencies

The script uses only the Python standard library. No additional packages are required.

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in cli-tool/components/skills/creative-design/luma-imagegen of davila7/claude-code-templates.

  • SKILL.md
  • scripts/luma_imagegen.py

Open the folder on GitHubat commit c0ca7da

Compare with similar skills

Luma Imagegen next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Luma Imagegen compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Luma Imagegen this skilldavila7/claude-code-templates33k—~1.7kAutomated safety check: NotesMIT
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
Structured Image Generationbytedance/deer-flow84k4 repos~2.9kAutomated safety check: PassMIT
Canghe Comicfreestylefly/canghe-skills4618 repos~3.2kAutomated safety check: PassNone
Generate Imageynulihao/AgentSkillOS61810 repos~1.7kAutomated safety check: NotesNone
GPT Image Generation CLIwuyoscar/GPT-Image2-Skill5.7k—~2.5kAutomated safety check: NotesMIT

Similar skills

  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated today
    Media & CreativeAuto-check passed
  • Structured Image Generation

    bytedance/deer-flow

    Turns an image request into a structured JSON prompt and runs a bundled Python script to generate the picture, optionally guided by reference images.

    84k GitHub starsUsed in 4 repos~2.9k tokens
    Media & CreativeAuto-check passed
  • Canghe Comic

    freestylefly/canghe-skills

    Knowledge comic creator supporting multiple art styles and tones.

    461 GitHub starsUsed in 8 repos~3.2k tokens
    Media & CreativeAuto-check passed
  • Generate Image

    ynulihao/AgentSkillOS

    Generate or edit images using AI models (FLUX, Gemini). An agent skill from ynulihao/AgentSkillOS.

    618 GitHub starsUsed in 10 repos~1.7k tokens
    Media & CreativeAuto-check: notes
  • GPT Image Generation CLI

    wuyoscar/GPT-Image2-Skill

    Generates and edits images with GPT Image 2 or 2.5 through a packaged CLI and a prompt gallery, after settling which model fits the request.

    5.7k GitHub stars~2.5k tokensUpdated 10 days ago
    Media & CreativeAuto-check: notes
  • Minimal Zine Poster Generator

    LiamGvchi/gc-minimal-zine-poster

    Creates or analyzes quiet, paper-texture zine posters with big negative space, one color accent and experimental type, returning an image prompt and the generated poster.

    7.3k GitHub stars~2.9k tokensUpdated 1 mo ago
    Media & CreativeAuto-check passed

More from davila7/claude-code-templates

All 479 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    33k GitHub starsUsed in 11 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    33k GitHub starsUsed in 9 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    33k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    33k GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    33k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    33k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Questions about Luma Imagegen

What does Luma Imagegen do?

A skill your agent uses when the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively, then calls the API using the bundled script. Luma Imagegen is an agent skill from davila7/claude-code-templates. Use when the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively, then calls the API using the bundled script.

When should I use Luma Imagegen?

Luma Imagegen fits situations like: the user asks to generate images via the Luma AI API (Dream Machine / Photon); collects a prompt and options interactively; then calls the API using the bundled script.

How do I install Luma Imagegen in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill luma-imagegen -a claude-code`. Or copy the skill folder (cli-tool/components/skills/creative-design/luma-imagegen in davila7/claude-code-templates) into .claude/skills/luma-imagegen in your project. Claude Code loads it when a task matches its description.

How do I install Luma Imagegen in Codex?

Run `npx skills add davila7/claude-code-templates --skill luma-imagegen -a codex`. Or copy the skill folder (cli-tool/components/skills/creative-design/luma-imagegen in davila7/claude-code-templates) into .agents/skills/luma-imagegen in your project. Codex loads it when a task matches its description.

Can I use Luma Imagegen in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill luma-imagegen -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/luma-imagegen, .gemini/skills/luma-imagegen, .github/skills/luma-imagegen and .opencode/skills/luma-imagegen in your project.

What does Luma Imagegen need to run?

Going by SKILL.md and its folder, Luma Imagegen needs Python for the scripts in its folder, the command-line tools its instructions call (python3) and credentials named LUMA_API_KEY. Our summary lists: Python 3; A credential in LUMA_API_KEY.

Does Luma Imagegen access the network?

SKILL.md names 1 domain. As links in the text: lumalabs.ai. This is read from the text; nothing was executed.

Is Luma Imagegen safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Luma Imagegen use?

Luma Imagegen is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Luma Imagegen use?

About 1.7k tokens (SKILL.md is roughly 6.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Luma Imagegen?

Skills that share tags, products or a category with Luma Imagegen: AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), Structured Image Generation (bytedance/deer-flow, 84k stars), Canghe Comic (freestylefly/canghe-skills, 461 stars) and Generate Image (ynulihao/AgentSkillOS, 618 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Luma Imagegen?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,512 GitHub stars. The repository holds 479 skills in this directory. The repository was last updated on October 10, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.