imagine
Skill2 starsChanged 4 months agoMITView on GitHub
How to use the image_gen and image_edit tool calls in Grok Build: when to build a visual with code instead of generating it, prompt-craft, reference-first handling of real people, factual grounding, and asset-consistency. Load this whenever generating or editing an image is on the table, i.e. when an image_gen or image_edit call is being considered or about to be made. Tool-usage-driven, not triggered by a user merely mentioning images.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- NighmareGit/skunkworks-toolboxedited, first seen Aug 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- NighmareGit/skunkworks-toolbox★ 193% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 12 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
When the output must get specific text, numbers, data, or structure right, don't trust the first result - verify it in a loop:
- Distinctive: line 34
If anything is wrong, fix and re-verify:
- Distinctive: line 38
Only finish when the discrete content is exactly correct.
- Very specific: line 45
Anchor recurring subjects to a reference: When a character, object, setting, or look recurs across images or shots, generate one canonical …
- Distinctive: line 49
Don't assume tool behavior: Don't invent tool parameters, return values, or environment capabilities that aren't actually provided.
- Distinctive: line 72
Use for generic or invented subjects, or to create a base image you'll edit later.
- Distinctive: line 86
Use to restyle, recolor, add or remove elements, preserve likeness, transfer style, remix, or iterate on a generated result.
- Distinctive: line 96
Use one coherent scene per prompt.
- Distinctive: line 101
Search the web first to confirm identity, role, relationship, or event, even when it seems obvious.
- Very specific: line 102
Use a single strong reference with image_edit.
- Distinctive: line 103
If no suitable reference exists, ask the user to upload one rather than generating from a weak base.
- Distinctive: line 121
Favor frequent, short shots: - prefer more 6s shots over fewer long ones.
- Very specific: line 125
Use reference_to_video only if the user asks for it or a shot genuinely needs multiple references - and even then, prefer composing those …
- Distinctive: line 130
Minimal but interesting: keep each shot to one clear subject and a single, simple motion or camera move.
- Distinctive: line 137
Don't loop the same clip unless asked.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Imagine
Guidance for the two image tool calls in Grok Build:
image_gen- generate a new image from a text prompt.image_edit- modify an existing image using a text prompt and source image.
Apply this whenever you're considering or about to call either tool.
Build accurate visuals with code, not the image tools
- Image models are unreliable at exact text, numbers, and structure. They can handle short text or a simple layout, but they often garble words, invent numbers, draw chart bars that match no data, or point diagram arrows nowhere, and the more that has to be exact, the worse they do. A detailed prompt doesn't make it dependable, and an
image_editpass usually won't fix it. So when a result needs specific text, data, or structure to be correct (charts from real numbers, labeled or technical diagrams, math explainers, tables, screens with real copy, and multi-panel layouts like contact sheets, storyboards, or comic grids where the frame, panel borders, and labels must be exact), construct the asset with code, where you control the exact content. Prefer HTML and CSS, which give much better layout, typography, and polish than Python plotting. When only the look matters (photos, illustrations, characters, scenes, decorative art), the image tools are the right choice. Which one fits depends on what the output needs to get right, not on how the request is worded.
Verifying discrete accuracy (loop)
When the output must get specific text, numbers, data, or structure right, don't trust the first result - verify it in a loop:
- Produce the result (generate, or per Build accurate visuals with code, construct it in code).
- Inspect the actual output - use image understanding to read a generated image back (or check the rendered code) - and confirm every word, number, label, and structural detail matches the requirement, and that nothing overlaps, clips, or runs off-canvas.
- If anything is wrong, fix and re-verify:
- Garbled text, invented numbers, or broken layout from an image model? Don't just re-prompt - it will likely garble it again. Rebuild it with code.
- Overlapping or clipped elements in code-built output? Re-lay-out with auto-layout (HTML/CSS) rather than nudging coordinates by hand.
- Otherwise make one targeted edit.
- Only finish when the discrete content is exactly correct. If it can't be made accurate, tell the user instead of shipping something wrong.
Core Principles
- You own the prompt. If the user gives a detailed prompt or asks you to use theirs, use it verbatim. Otherwise craft the final prompt: front-load the subject, give strong high-level direction for mood, composition, lighting, and style without over-specifying every detail, write natural prose rather than keyword tags, and describe positively instead of using negative prompts. For edits, describe only what changes. Target 2-5 sentences.
- Reference-first for real people. Never use pure
image_genfor a named real person or group, including face swaps, posters, cartoons, and cinematic or editorial depictions. Useimage_editwith a real reference instead, and never produce non-consensual, sexualized, or minor-involving likenesses. See Real People and References for the procedure. - Ground facts with search first. If any part of the request depends on a real-world fact, identity, brand or product, place, event, or top/latest/current result, search the web before generating and put the actual verified details into the prompt. Don't rely on memory, and don't write vague placeholders like "the current president"; write the verified name.
- Anchor recurring subjects to a reference. When a character, object, setting, or look recurs across images or shots, generate one canonical reference first and derive every reappearance from it with
image_edit/reference_to_video- never a freshimage_gen. See Consistency across shots and panels. - Handle failures gracefully. On a moderation or safety block, stop; don't retry and don't paraphrase the prompt to evade the filter. Tell the user it was blocked and offer a different direction. If a reference is weak or a result looks off-target, say so and ask for an upload or redirect rather than silently iterating.
- Plan multi-step workflows. Sequence the steps; only parallelize generations that belong to the same step.
- Review at the end. Confirm the generations you intended actually executed and match what was asked.
- Don't assume tool behavior. Don't invent tool parameters, return values, or environment capabilities that aren't actually provided; verify rather than guess.
Choosing the Tool
| Situation | Tool |
| New image, no source image | image_gen |
| Edit, restyle, recolor, add, remove, or extend an existing image | image_edit |
| Iterate on a previous result while keeping composition | image_edit |
| Named real person or group | image_edit with a real reference after a web search |
| Generic, invented, or non-factual subject from scratch | image_gen |
Rule of thumb: no source image -> image_gen; source image -> image_edit.
image_gen
Generates a new image from a text prompt.
Inputs:
prompt(required) - full description of the desired image.aspect_ratio- e.g.1:1,16:9,9:16,4:3,3:4, orauto.
Use for generic or invented subjects, or to create a base image you'll edit later. Not for named real people; see Reference-first for real people.
To produce multiple variations, make multiple image_gen calls with distinct prompts. The tool does not expose n or count parameters.
image_edit
Transforms an existing image according to a prompt.
Inputs:
prompt(required) - describe the desired transformation, and note what should stay the same.image(required) - one or more source/reference images as filesystem paths ordata:image/...;base64,...URLs. Prefer a single clean reference for reliable results.aspect_ratio- optional; used for multi-image edits. Single-image edits preserve the input image aspect ratio.
Use to restyle, recolor, add or remove elements, preserve likeness, transfer style, remix, or iterate on a generated result.
To produce multiple variations, make multiple image_edit calls. The tool does not expose n or count parameters.
Writing Strong Prompts
Describe, roughly in this order: subject -> action/pose -> setting -> style -> composition -> lighting/mood -> key details.
- Be specific and concrete; lead with the most important elements.
- State what to include rather than what to exclude.
- Use one coherent scene per prompt.
- Match
aspect_ratioto the use case when usingimage_gen:9:16for phone/story,16:9for banner/video frame,1:1for avatar/icon.
Real People and References
- Search the web first to confirm identity, role, relationship, or event, even when it seems obvious.
- Use a single strong reference with
image_edit. A user-uploaded photo is best; otherwise use a high-quality found reference and cite the source.image_editcan take more than one reference, but one clean reference is more reliable. - If no suitable reference exists, ask the user to upload one rather than generating from a weak base.
Consistency across shots and panels
Grok Build has no persistent character or style memory, so consistency is manufactured on every call - independent generations of "the same" subject always drift.
- Anchor to a reference. For any recurring character, asset, wardrobe, location, or effect/color-grade ("look"), generate one canonical reference first, then produce every reappearance with
image_edit(orreference_to_video) seeded from it. Restate the subject's fixed traits and any hard rule in each prompt, and verify each result against the reference. For coverage - one scene from several angles - derive each angle from a single scene master, not from fresh generations. - Multi-panel sets are a pipeline, not one image. A storyboard, contact sheet, comic page, or scene series can't be a single generation; it collapses into a few generic frames with drifting faces and dropped panels. Instead: (1) build the references above; (2) generate each panel separately, seeded from the references it needs, verifying each; (3) assemble the grid, borders, and labels in code (per Build accurate visuals with code).
Video
The video tools below may not exist - verify they're available before calling them; if they're not, the user cannot do video gen with Imagine.
Video starts from an image - there is no text-to-video tool. Default to image_to_video.
Think in shots. Build video as a planned sequence of short shots, not one long take:
- Plan the story as shots - break the idea into distinct shots, one beat each.
- Favor frequent, short shots - prefer more 6s shots over fewer long ones; more cuts keep it dynamic and interesting.
- Create each shot's source image, seeding recurring characters and settings from their references (Consistency across shots and panels) via multi-image
image_editrather than a freshimage_gen. - Animate each shot with
image_to_video- the source becomes frame 1.
Use reference_to_video only if the user asks for it or a shot genuinely needs multiple references - and even then, prefer composing those references with a multi-image image_edit and animating the result with image_to_video.
Key behaviors:
- Prompt-craft: one short, vivid moment in present tense with a clear camera movement, in 1-2 sentences.
- Minimal but interesting: keep each shot to one clear subject and a single, simple motion or camera move. Avoid complex or multi-action animation (models handle it poorly); make the shot interesting through composition, lighting, and a strong moment, not busy motion.
- Complex source image? An intricate frame (busy geometry, fine detail, heavy reflections) warps when animated. If you must use it, keep the subject fixed and move only the camera (slow push-in, orbit, or parallax), or break it into tighter, simpler shots. For new shots, generate a simpler, animation-friendly base image up front instead of animating a busy one.
image_to_videoanimates from frame 1, so stage the intended first frame withimage_gen/image_editfirst.- Continuity between shots: seed a connected shot from the previous shot's last frame (extract it with ffmpeg) so light, motion, and identity carry over.
- Aspect ratio: set it on the source image (
image_genaspect_ratio); don't re-crop an existing video. - Duration: 6s or 10s only (prefer 6s shots); round to the nearest.
- Real people: reference-first - drive the video from a verified reference image; never animate a named person without one.
- Don't loop the same clip unless asked.
Assemble shots with FFmpeg using stream copy so there's no quality loss: ffmpeg -f concat ... -c copy - never re-encode. Keep every shot at the same resolution and frame rate so the copy works.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

