controlled-generation
Skill8 starsChanged 5 months agoMITView on GitHub
Lock the composition of a generated image to a structural guide while you change everything else. Use when the user says "same pose, new character", "keep this layout, restyle it", "match this sketch", "turn my floor plan into a render", "same product silhouette, different finish", or wants interior redesign, sketch-to-render, or controlled asset variations. A control map (pose, edges, depth, segmentation) holds the structure, the prompt brings the new look. To keep a character's identity consistent rather than just its structure, use character-consistency.
In this repository32 other files it gives its agents.
- add-audio-to-videoSkill
- animate-imageSkill
- bring-your-own-modelSkill
- character-consistencySkill
- cinematic-videoSkill
- composite-sceneSkill
- dialogue-audioSkill
- edit-imageSkill
- edit-videoSkill
- game-assets-2dSkill
- image-to-3d-assetSkill
- llm-agentSkill
- logos-and-vectorsSkill
- multi-shot-videoSkill
- musicSkill
- photoreal-stillsSkill
- product-ad-videoSkill
- product-photographySkill
- reframe-videoSkill
- replace-in-videoSkill
- restore-and-upscaleSkill
- runware-modelsSkill
- runware-promptingSkill
- runware-runSkill
- talking-avatarSkill
- text-in-imageSkill
- train-style-modelSkill
- ugc-adSkill
- video-upscaleSkill
- vision-understandingSkill
- voice-cloningSkill
- voiceoverSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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
- Very specific: line 44
Extract the control map: Run taskType: "controlNetPreprocess" with inputImage (URL or base64) and preProcessorType set to the map you want …
- Very specific: line 45
Generate conditioned on the map: Run taskType: "imageInference" synchronously with your model (base), the prompt, and a controlNet array …
- Very specific: line 58
Control mode trades guide against prompt: Use balanced for a mix, controlnet to prioritize structure over the prompt, prompt to let text …
- Distinctive: line 72
Prep the source for clean edges: when using Canny: clear outlines, distinct features, decent contrast, minimal noise.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Controlled generation (ControlNet)
Generate a new image whose composition matches a source image while its style, subject, or finish changes freely. You extract a structural map (pose, Canny edges, depth, or segmentation) from the source, then condition generation on that map. This is the "same composition, new look" lever: interior redesign, sketch-to-render, and repeatable product or game-asset variations.
Inputs to collect
- The source image to take structure from (a photo, sketch, render, or existing asset). Required.
- Which structure to preserve: silhouette/outlines (Canny), human pose (pose), 3D layout/perspective (depth), or scene regions (segmentation). If unstated, infer from the goal: outlines for objects/assets, pose for people, depth for rooms/scenes.
- What changes: the new style, subject, material, or palette described as a prompt.
- How tightly to hold the structure (loose restyle vs strict trace) and how many outputs.
Models
Two pieces, both confirmed live via runware-models before calling, never hardcoded:
- A ControlNet preprocessor (
form:controlnetconsumers depend on it) to build the control map:- Canny / edges:
runware:controlnet-preprocess@canny(op:edge-detection) - Depth:
runware:controlnet-preprocess@depth(op:depth-estimation) - Pose:
runware:controlnet-preprocess@openpose(op:pose-estimation) - Segmentation:
runware:controlnet-preprocess@seg(op:segmentation) - Soft edges:
runware:controlnet-preprocess@softedge(op:edge-detection)
- Canny / edges:
- A base model + a matching ControlNet (
form:controlnet) for inference. The ControlNet must match both the base family and the map type:- FLUX.1 [dev] base
runware:101@1with FLUX Union Pro ControlNets: Cannyrunware:25@1, Depthrunware:27@1, Poserunware:29@1. - SDXL alternatives: Canny
runware:20@1, Depthrunware:3@1.
- FLUX.1 [dev] base
Confirm each AIR is live and the ControlNet is built for the base you chose. A LoRA can ride alongside to lock a style (see the game-assets-canny guide). Offer SDXL as the faster/cheaper tier and FLUX dev as the quality tier.
Workflow
Specializes the runware-run contract for a two-call control pipeline.
- Resolve schemas. Inspect the preprocessor and the inference-model schemas via
runware-run. Use only schema-valid fields. - Extract the control map. Run
taskType: "controlNetPreprocess"withinputImage(URL or base64) andpreProcessorTypeset to the map you want (canny,depth,openpose,seg). Keep the returned guide image. - Generate conditioned on the map. Run
taskType: "imageInference"synchronously with yourmodel(base), the prompt, and acontrolNetarray whose entry carries the matching ControlNetmodel, theguideImagefrom step 2, andweight/startStep/endStep. - Read the result. Images return synchronously as image URLs. Inspect for structure adherence vs creative freedom and adjust.
- For a set, reuse the same guide image across calls and vary only the prompt so every output shares one composition.
Load references/examples.md for three worked, schema-verified recipes (Canny edge-locked restyle, OpenPose pose-driven generation, depth-guided interior restyle) with both calls and the result shape.
Technique
Grounded in the FLUX dev game-assets-canny guide.
- Extract, then condition. The map carries the structure so the prompt no longer has to. Describe the new look in the prompt, not the geometry the guide already encodes.
- Tune Canny thresholds to set how much structure survives.
lowThresholdCannycatches subtle edges (more detail, more constraint),highThresholdCannykeeps only strong edges (cleaner, looser). Defaults work for most inputs. Push low for soft-transition art, push high to drop noise. - Control the structure-vs-creativity balance with steps.
startStep: 1, endStep: 10(on a ~30-step run) is the balanced default: guidance shapes the early layout, then the model is free to invent detail. A higherstartSteplets guidance kick in too late and structure adherence weakens. A higherendStepclamps the model to the source so hard that the new subject can barely emerge (good for pure restyle, bad for transformation). - Control mode trades guide against prompt. Use
balancedfor a mix,controlnetto prioritize structure over the prompt,promptto let text lead with the guide as a loose reference. Match map to intent. Canny for silhouettes and assets, pose for redirecting people, depth for rooms and perspective (interior redesign, sketch-to-render), segmentation to keep scene regions while restyling each.
Pick the pipeline by filling this routing template, then send the two calls:
control type: <canny | openpose | depth | seg> source image: <the URL or base64 to take structure from> preprocessor: <runware:controlnet-preprocess@<type>> base + controlnet: <runware:101@1 + runware:25@1 (canny) | 29@1 (pose) | 27@1 (depth)> (FLUX dev) steps / endStep: <~30 steps, endStep 10 for transform, 15+ for restyle>The control type drives every other line: it picks the preprocessor and the matching ControlNet, and how hard you hold structure (
endStep) follows the intent (transform vs restyle).- Prep the source for clean edges when using Canny: clear outlines, distinct features, decent contrast, minimal noise. Simplify a busy source before extracting.
Parameters that matter
preProcessorType:canny,depth,openpose,seg,softedge. Must match the ControlNet you pair it with.lowThresholdCanny/highThresholdCanny: Canny sensitivity. Lower low = more edges, higher high = fewer edges.controlNet[].guideImage: the preprocessor output, not the raw source.controlNet[].weight: how strongly the map steers generation. 1.0 is a balanced start.controlNet[].startStep/endStep: the window the guide is active.1/10on ~30 steps is balanced. RaiseendStepto hold structure harder, raisestartStepto weaken it.- Control mode:
balanced/controlnet/prompt. - Confirm every field name and range against the live schema (
runware-run). Never guess.
Quality bar
- The output's composition (pose / outline / layout) matches the source while the intended look changed.
- Structure is held to the right degree: recognizable, not a rigid trace that blocks the new subject (raise
endStepif too loose, lower it if too rigid). - The map type fits the goal (Canny silhouette vs depth layout vs pose).
- For a set, every image reads as the same composition. Retry outliers by adjusting thresholds, weight, or the step window, not by re-rolling blindly.
Related skills
runware-run (call the two-step pipeline), runware-models (confirm the preprocessor + ControlNet are live), runware-prompting (write the new-look prompt). Sibling outcomes: character-consistency (hold a subject instead of a composition), product-photography (controlled product variations).
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.

