Prompt Engineering for AI: Mastering Complex Physical Actions

When generating prompts for AI models like Qwen Image or Edit, there is often a temptation to describe complex physical actions in a single sentence. However, this approach frequently leads to hallucinations where the model fails to respect basic physics.

Illustration of a person removing their jacket, highlighting the arm exiting the sleeve.
Visual breakdown of the correct physical action for AI prompts.

To start, let’s look at how we might describe removing a sleeve. Initially, it seems simple enough: *She takes off her wetsuit, pulling one arm out of the sleeve.* But when you analyze the mechanics required for this action—moving from shoulder to elbow—you realize that compressing all these spatial relationships into one instruction is risky.

Spatial Attention vs. Temporal Steps

The core issue here lies in how models handle attention versus temporal steps. When a model hallucinates, it often fails the spatial check; for example, it might place fabric over skin without actually accounting for the arm’s position underneath.

Illustration showing the ghost arm hallucination glitch in AI generation.
Visual example of the spatial attention failure known as the ghost arm effect.

This is exactly what happens with the infamous «ghost arm» error. The model interprets *arm out of sleeve* as a final state rather than a continuous transformation, resulting in visually absurd but statistically plausible glitches where limbs or fabric are displaced.

Static Images and Intermediate States

To mitigate these errors in static image generation, you must force the model to resolve intermediate states. Instead of asking for the final result, describe a configuration that is physically verifiable, such as: *Her right arm is halfway out of the wetsuit sleeve, with the neoprene stretched around her forearm.* This forces the AI to maintain spatial coherence.

Video Generation and Mechanical Storyboards

The real breakthrough occurs when moving from static images to video generation. Video allows you to provide micro-actions rather than a single goal state. By explicitly describing the sequence—gripping the fabric, sliding it downward, stretching the neoprene—you are essentially providing the model with a mechanical storyboard.

Four-panel grid showing the step-by-step breakdown of an action.
Example of a mechanical storyboard used for video generation.

This technique is highly effective for complex sequences like removing a wetsuit. By dividing the action into three to five key poses, you ensure that every step of the physical interaction is accounted for.

In conclusion, avoiding single-instruction prompts and instead breaking down actions into intermediate states or storyboards significantly improves accuracy. This approach ensures your AI models understand not just where a limb is, but how it moves through space over time.