To achieve the highest fidelity image reconstruction through this two-step process, the initial instruction must compel the multimodal LLM to generate an ultra-structured, exhaustive, and measurement-oriented description. Below is the optimized instruction formula:
Step 1 Instruction Template
Goal: Extract a description so precise that it functions like a "digital blueprint" for the second LLM.
**ROLE**: You are a forensic image analyst. Your task is to decompose the given image into a machine-readable specification for exact replication.
**OUTPUT FORMAT**: Use JSON with strict schema:
{
"metadata": { "style": "[art medium, e.g., oil painting/3D render/photo]", "palette": ["hex_color1", "hex_color2", ...], "dimensions": "aspect_ratio" },
"objects": [
{
"id": "unique_ID",
"type": "object_class",
"position": { "x": "left_center_right", "y": "top_mid_bottom", "grid_ref": "x%/y%" },
"size": "%_of_image_width/height",
"color": ["hex", "material/texture"],
"shape": "geometric_description",
"relations": ["adjacent_to_id", "behind_id", ...]
},
...
],
"scene": {
"composition": "[rule_of_thirds/golden_ratio/radial]",
"lighting": { "direction": "angle", "intensity": "high/medium/low", "shadows": "position" },
"background": "layered_description",
"text": { "content": "exact_string", "font": "serif/sans", "size": "%_relative", "color": "hex" }
}
}
**RULES**:
1. **Exhaustive Inventory**: Catalog every element (≥5 pixels). Use IDs for reference.
2. **Quantify Relentlessly**:
- Positions as grid coordinates (e.g., "x: 30%, y: 70%")
- Sizes as percentages of image width/height
- Colors as hex codes + material (e.g., "#FF5733 matte plastic")
3. **Spatial Physics**:
- Depth order (foreground/midground/background)
- Object adjacency/overlap (e.g., "object_A overlaps object_B by 15%")
4. **Style DNA**:
- Artistic medium (e.g., "watercolor with bleed textures")
- Lighting physics (e.g., "hard shadows at 45° NE")
- Repeating patterns (e.g., "grid of 8x8 diamonds, each 2% width")
5. **Zero Abstraction**:
- NO interpretations (e.g., "happy scene" → INVALID)
- ONLY observable facts (e.g., "corners curved radius ~3% width" → VALID)
Why This Works
- JSON Schema forces systematic data capture, reducing ambiguity.
- Hex Codes + % Measurements enable pixel-accurate reconstruction.
- ID-Based Relations allow the image generator to spatially reassemble objects.
- Style Descriptors (e.g., "oil brushstrokes") transfer textural intent.
- Machine-Parsable Structure bypasses linguistic variability in free-text prompts.
Example Output Snippet
{
"metadata": {
"style": "vector illustration",
"palette": ["#FF0000", "#00FF00", "#0000FF"],
"dimensions": "16:9"
},
"objects": [
{
"id": "obj1",
"type": "apple",
"position": { "x": "center", "y": "mid", "grid_ref": "50%/50%" },
"size": "15% width / 20% height",
"color": ["#FF0000", "glossy"],
"shape": "sphere with stem indentation",
"relations": ["on obj2"]
},
{
"id": "obj2",
"type": "table",
"position": { "x": "bottom", "y": "bottom", "grid_ref": "0-100%/85-100%" },
"size": "100% width / 15% height",
"color": ["#964B00", "wood grain horizontal"],
"shape": "rectangle"
}
],
"scene": {
"composition": "rule_of_thirds",
"lighting": { "direction": "top-left", "intensity": "high", "shadows": "bottom-right" },
"background": "gradient #FFFFFF to #F0F0F0",
"text": null
}
}
Critical Considerations
- LLM Limitations: Current models hallucinate details. Mitigate by:
- Adding:
"Uncertain elements": "flag as 'low_confidence'"
- Using temperature=0 to reduce creativity.
- Token Limits: For complex images, prioritize:
- Foreground objects
- Color/style anchors
- Composition rules
- Validation: Run a reverse test (image→description→image) with simple shapes to calibrate.
This transforms subjective "description" into objective specification engineering, maximizing replicability within generative AI constraints.