Docs / Images

Images — generation & handling

How LHAI turns text into photographs, what the gray placeholder means, and how to replace an image with your own.

How it works

When the AI builds a page, it inserts image placeholders with a data-lhai-image attribute whose value is an English prompt. Example:

<div data-lhai-image="editorial photo of a chef plating pasta under warm kitchen light, film grain"
     style="min-height:300px;border-radius:16px;background:#e8e8ec"></div>

When you click Generate Images after a build, LHAI walks the DOM, finds every placeholder, and fires them through the image engine in parallel (two at a time). The returned URLs are pasted as background-image on divs, or src on <img> tags.

Alias: data-ai-image is accepted as a synonym for data-lhai-image. LHAI normalizes the attribute name at runtime, so both forms work interchangeably in hand-written HTML.

Writing good image descriptions

The difference between a cheap stock look and a real editorial photograph is the prompt. Rules of thumb:

WeakStrong
"a gym""wide-angle photo of a minimalist concrete gym at dawn, single trainer coaching a barbell lift, soft window light"
"an office""overhead shot of a warm wooden co-working table with laptop, coffee, and a potted monstera, shallow depth of field"
"a person""portrait of a Black woman in her forties, smiling, wearing a tailored beige blazer, studio softbox lighting, neutral backdrop"

Gray placeholders and what they mean

If you see a gray box with a camera icon and "Click to generate," it means one of three things:

No emoji fallbacks. Old builds used to drop 📷 / 🔥 / 👤 glyphs into failed placeholders. LHAI 1.0.29 and later never do that — if an image fails, you get a styled gray box with a clear action, not an emoji in your production HTML.

Manual upload & regenerate

Click any image (successful or placeholder). A small popup appears with three options:

Costs

💰 10 credits per image, whether it's a page-build batch, a single regenerate, or an AI-generated Visual-Editor background.