luma-imagegen
What it does
This skill lets your AI agent make images using Luma AI's Photon model. It is for people who want Luma's image style or want to guide a new image with a reference picture.
When to use it
- βWhen you want an image made with Luma AI from a written description.
- βWhen you have a reference picture and want the new image to follow its style or character.
- βWhen you want to change or restyle an existing image with Luma.
Skill link
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/creative-design/luma-imagegen/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βUse Luma to create a fantasy city poster in a square format.β
5 new skills a week. 1 minute to read.
How it works
The agent asks for your prompt, the shape of the image and the model. It then sends the request to Luma, waits until the image is ready, and saves it to a folder in your project.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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
- Check API key β detect
LUMA_API_KEYin environment. If missing, guide the user (see below). - Collect inputs β ask the user for: prompt, aspect ratio, model choice, and any optional reference images.
- Build the structured prompt β augment the user's description into a labeled spec (see prompt template below).
- Run the bundled CLI β execute
scripts/luma_imagegen.pywith the collected parameters. - Poll until complete β the script handles async polling automatically; wait for
state: completed. - Display result β show the final image URL and download the image to
output/luma/. - 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:
python3 ${CLAUDE_SKILL_DIR}/scripts/luma_imagegen.py --check-key
If LUMA_API_KEY is missing:
- Tell the user the key is not set.
- Direct them to generate one: https://lumalabs.ai/dream-machine/api/keys
- Ask them to add it to their
.envfile or export it in their shell:export LUMA_API_KEY=your_key_here - Never ask the user to paste the key in chat. Ask them to set it locally and confirm when ready.
- Once confirmed, retry the
--check-keycommand to verify.
Interactive questions to ask the user
Ask these questions before running the generation:
- Prompt (required): "What image do you want to generate? Describe the scene, subject, style, and any important details."
- 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" - Model (optional, default
photon-1): "Usephoton-1(higher quality) orphoton-flash-1(faster and cheaper)?" - 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
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:
| Flag | Default | Description |
|---|---|---|
--prompt |
(required) | Text description of the image |
--aspect-ratio |
16:9 |
1:1, 3:4, 4:3, 9:16, 16:9, 9:21, 21:9 |
--model |
photon-1 |
photon-1 or photon-flash-1 |
--image-ref |
β | Public URL for style/structure reference |
--image-ref-weight |
0.85 |
Weight of reference image (0.0β1.0) |
--modify-ref |
β | Base image URL to modify |
--modify-ref-weight |
0.5 |
Weight for modification fidelity |
--out |
output/luma/ |
Output directory for downloaded images |
--poll-interval |
3 |
Seconds between polling requests |
--check-key |
β | Verify LUMA_API_KEY is set and exit |
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_reasonfrom 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 con
FAQ
What do I need before I start?
You need a Luma API key set in your environment. If it is missing, the agent asks you to add one.
Can I try again if I do not like the result?
Yes, the agent can adjust the prompt and run it again.
Where does the image go?
The image is downloaded to a luma output folder inside your project.
Details
Original description by the author
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.
Popularity
- GitHub stars
- 33k
- Ranking position
- #8694
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
owasp-security
33kTeaches your agent OWASP security guidance for web apps, APIs, mobile, containers and AI agents, so it can spot common weaknesses and suggest fixes.
agent-management
33kLets your agent create, list, hibernate, wake, rename and delete AI agents using the AI Maestro command line, managing each agent's lifecycle.
agent-messaging
33kLets your agent send, receive and reply to signed messages between AI agents, using the Agent Messaging Protocol, mostly on your own machine.
docs-search
33kLets your agent search auto-generated code documentation for function signatures, class definitions and comments, so it checks the real API before changing code.
Similar skills
gifgrep
394kLets your agent search GIF libraries, preview results, download a GIF, and pull out a still frame or a contact sheet of frames.
meme-maker
394kLets your agent pick a meme template, add your own captions, and create the meme as an SVG or PNG image.
ios-icon-gen
280kLets your agent generate icons for iOS apps. It uses Apple symbols or icons from other sources to create the correct files.