Mastering Layout Logic

GLM-Image Team18 min readExpert

Most AI image generators treat prompts as flat descriptions. GLM-Image is different—it understands spatial relationships, logical operators, and composition rules.

Why Layout Logic Matters

Imagine describing a poster to a human designer. You wouldn't just list elements—you'd explain where they go and how they relate.

Core Spatial Operators

Position Keywords

Horizontal Positioning

  • left - Align to the left side
  • center - Horizontally centered
  • right - Align to the right side
  • span - Stretch across an area

Vertical Positioning

  • top - Upper portion
  • middle - Vertically centered
  • bottom - Lower portion

Percentage-Based Layouts

Subject: Three movie posters side by side Logic: Left poster 30%, center poster 40%, right poster 30%

Logical Relationships

Complex Layout Patterns

Layout: 2x3 grid Cell 1 (top-left): Company logo Cell 2-3 (top): Navigation menu spanning Cell 4-6 (bottom): Product showcase area

Real-World Applications

Case Study: E-commerce Product Card

Subject: Product image, title, price, and buy button Layout: Image top 60%, info area bottom 40% Within info: Title top-left, price top-right, button bottom span Spacing: 16px padding on all sides

Best Practices

  • Start with broad percentages, then refine
  • Use even numbers for cleaner calculations
  • Leave 5-10% as breathing room between elements
  • Test complex layouts in stages
  • Document your successful layouts for reuse