AI illustration generation for articles: automate your visuals
Finding a relevant illustration for an article takes 20 minutes, and stock licenses are expensive — while competitors publish content with unique visuals generated in seconds. Automatic article illustration solves this: a pipeline that extracts a prompt from the text, generates an illustration, and uploads it to the CMS. No manual work, no licensing fees. We offer a ready-made solution with style customization and integration for any CMS.
Problem: stock images don't solve it
Stock photos are a compromise: limited selection, repetition by competitors, high commercial use fees. For technical blogs or educational platforms, stocks often lack specific scenes. AI generation delivers 1:1 uniqueness to content, zero royalties, and full style control. We've implemented this approach in 15+ projects — from news portals to edtech platforms. An edtech platform with 500+ articles reduced visual costs by 4x, saving up to $1,500 per month on stock licenses.
Model selection: DALL-E 3 and SDXL
We use two models: DALL-E 3 (cost: ~$0.04 per image) and SDXL with LoRA for blogs and strict brand styles. DALL-E 3 produces near-final results without post-processing — just resize. SDXL with LoRA on your references gives 100% adherence to corporate guidelines. According to our measurements, AI generation is 15x faster than manual search and significantly cheaper than hiring a designer. The average cost per illustration ranges from $0.01 to $0.10 depending on the model, while a stock license costs several dollars. For more details on capabilities, see the OpenAI Images API documentation.
How to automate visual creation?
Prompt extraction
The key step is prompt extraction. We use GPT-4o-mini: it analyzes the article section and forms a scene description in English (for better model understanding). The prompt includes object, action, environment — no abstractions. Prompt engineering accurately conveys the needed scene.
Prompt extraction code
from openai import AsyncOpenAI
client = AsyncOpenAI()
async def extract_illustration_prompt(
article_text: str,
section_text: str,
style: str = "flat illustration",
language_out: str = "en"
) -> str:
response = await client.chat.completions.create(
model="gpt-4o-mini",
messages=[{
"role": "system",
"content": f"""Create a prompt for an illustration for the article section.
Style: {style}.
Requirements:
- Description of scene/object (not abstractions)
- No text or labels on the image
- No people unless explicitly mentioned
- Language: {language_out}
- Length: 30-60 words
Return only the prompt, no explanations."""
}, {
"role": "user",
"content": f"Article about: {article_text[:500]}\nSection: {section_text[:300]}"
}]
)
return response.choices[0].message.content.strip()
Batch generation
Example of batch generation for an entire article — every Nth section gets an illustration. We use a dataclass ArticleSection to store content and the generated image.
from dataclasses import dataclass
@dataclass
class ArticleSection:
heading: str
content: str
illustration_prompt: str = ""
illustration_bytes: bytes = b""
async def illustrate_article(
article_markdown: str,
style: str = "flat",
illustrate_every_n_sections: int = 2
) -> list[ArticleSection]:
sections = []
current_heading = "Introduction"
current_content = []
for line in article_markdown.split("\n"):
if line.startswith("## ") or line.startswith("### "):
if current_content:
sections.append(ArticleSection(current_heading, "\n".join(current_content)))
current_heading = line.lstrip("#").strip()
current_content = []
else:
current_content.append(line)
if current_content:
sections.append(ArticleSection(current_heading, "\n".join(current_content)))
for i, section in enumerate(sections):
if i % illustrate_every_n_sections == 0:
section.illustration_prompt = await extract_illustration_prompt(
article_markdown[:500], section.content, style
)
section.illustration_bytes = await generate_article_illustration(
section.content, style
)
return sections
Illustration styles and their application
We have preset 7 styles that cover 90% of editorial tasks. Each style is a set of keywords in the prompt that define mood and technique.
| Style | Description | When to use |
|---|---|---|
| flat | Minimalism, pastel colors, clean lines | General articles, blogs |
| isometric | 3D projection, technicality | Technical guides, infographics |
| hand_drawn | Sketch, watercolor, ink | Creative, informal topics |
| editorial | Expressive, vibrant, magazine-like | Analytics, reports |
| tech_blog | Geometric shapes, gradients | IT blogs, hubs |
| corporate | Business, blue palette | Corporate reports, presentations |
| educational | Diagrams, clear labels | Learning materials, tutorials |
Implementation process by stages
- Content analysis — study the structure of your articles, categories, style.
- Model and style selection — test DALL-E 3, FLUX, or SDXL with LoRA.
- Pipeline development — integration with your CMS via REST API.
- Test on 10 articles — check quality, adjust prompts.
- Deployment — production launch, p99 latency monitoring.
Result: 100% unique illustrations, publication time reduced by 90% — from a client feedback (edtech platform with 500+ articles). Our experience guarantees a smooth transition.
What's included in the AI generation service
The service includes:
- Ready script for prompt and illustration generation.
- Integration module for WordPress, Ghost, Tilda, or any other CMS.
- Style customization under your brand (up to 3 LoRA models).
- API access for automatic image upload.
- Editor documentation with prompt examples.
- Team training on system usage (up to 2 hours).
- 3-month support after launch.
Integration with CMS
We provide an API wrapper — one HTTP request with the article text, output array of image URLs. For WordPress — one-click plugin. Integration requires no technical knowledge from editors.
class CMSIllustrationIntegration:
async def upload_to_wordpress(self, image_bytes: bytes, title: str) -> str:
import httpx
async with httpx.AsyncClient() as client:
resp = await client.post(
f"{WP_URL}/wp-json/wp/v2/media",
headers={
"Authorization": f"Basic {WP_AUTH}",
"Content-Disposition": f'attachment; filename="{title}.jpg"',
"Content-Type": "image/jpeg"
},
content=image_bytes
)
return resp.json()["source_url"]
Comparison of manual approach vs AI generation
| Criteria | Manual search | AI generation |
|---|---|---|
| Time per illustration | 15-30 min | 5-15 sec |
| Cost per 1000 illustrations | High (licenses + labor) | Low (API tokens) |
| Uniqueness | Low (repetition by competitors) | 100% unique |
| Style control | Limited by stock | Full (prompt, LoRA) |
Case study: educational portal
Client — an online school with 2000 articles. Previously ordered illustrations from freelancers — high cost and weeks of lead time. We implemented a pipeline using DALL-E 3 + custom SDXL style: now all articles are illustrated in two days, costs reduced by 80%, and engagement (Time on Page) increased by 25% due to relevant images. Savings on stock licenses reached up to $1,500 per month. Unique images enhanced brand recognition. Create an illustration media kit for your content.
Assess your project: contact us for a consultation. Order AI illustration generation implementation. Get a consultation on your project.







