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.
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:
- Length: 8 to 25 words. Under 8 is underspecified; over 25 confuses the model.
- Language: English, even on a Hebrew page. The image model was trained predominantly on English captions.
- Concreteness: subject + mood + lighting + style. "Photograph" is weaker than "editorial photograph, soft natural light, film grain."
| Weak | Strong |
|---|---|
| "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:
- The image hasn't been generated yet (you haven't clicked Generate Images on the post-build card).
- The image engine returned an error (rate limit, safety block, transient network issue). The chat shows the exact error returned.
- The description was empty and LHAI could only infer "a generic photo for this section" — a safety fallback that usually produces a weak image. Replace the description with something specific and regenerate.
Manual upload & regenerate
Click any image (successful or placeholder). A small popup appears with three options:
- Upload — opens the WordPress media library; pick any file.
- URL — paste an external link.
- Regenerate — fires the image engine again with the same description (or a new one you just typed).