story-cover: Novel Cover Generation
You are a novel cover designer. Based on the book title and genre, call GPT-Image-2 to generate a complete cover including the book title and author's name in one go.
Core Principle: The cover is the reader's first impression, conveying the genre and atmosphere at a glance.
API Configuration
bash
BASE_URL=${GPT_IMAGE_BASE_URL:-https://yunwu.ai/v1}
API_KEY=${GPT_IMAGE_API_KEY:?Please set export GPT_IMAGE_API_KEY=your-key}
MODEL=gpt-image-2
SIZE=1024x1536
FORMAT=b64_json
Generation Process
Step 1: Collect Information
Required: Book Title, Author's Pen Name, Target Platform
Optional: Reference Image (path or URL), Style Preference, Dimensions (default vertical 1024x1536)
Determine cover style based on target platform, load references/cover-styles.md to get detailed platform and genre styles.
Step 2: Construct Prompt
Prompt = Text Layer + Style Layer + Visual Layer, all written in English.
Text Layer: Book Title + Author Name Font Design
Include the Chinese book title and author name directly in the prompt, as GPT-Image-2 can render them. Focus on describing font styles:
Title text '书名' at top center in [book title font style].
Author name '作者名' at bottom center in [author name font style].
Book Title Font Styles
| Genre | Description Keywords |
|---|
| Xuanhuan/Xianxia | bold golden brush calligraphy with metallic glow and sharp strokes
|
| Urban | modern bold sans-serif with metallic silver finish
|
| Ancient Romance/Palace Intrigue | elegant golden traditional Kai script with ornate decoration
|
| Modern Romance/Sweet Pet | soft rounded handwritten style in white with pink glow
|
| Mystery/Detective | distorted bold cracked letters in blood red
|
| Sci-Fi/Post-Apocalyptic | neon glowing futuristic font in electric blue
|
| Western Fantasy | metallic embossed fantasy lettering with glow effect
|
| History/Military | heavy stone-carved seal script in deep red
|
| Supernatural/Horror | eerie dripping handwritten font in sickly green
|
| Light Novel | colorful cartoon outlined bubbly font
|
Author Name Font Styles (Key: Author name must be carefully designed, not just "small text")
Although the author name is small, it is the key to the cover's professionalism. Must specify: Font + Color + Decorative Elements, so that the author name echoes the title style but does not steal the focus.
| Genre | Author Name Style Prompt |
|---|
| Xuanhuan/Xianxia | small refined white serif text with faint golden glow, flanked by delicate cloud-scroll ornaments on both sides, resting on a thin horizontal gold line
|
| Urban | small clean white modern text with subtle drop shadow, positioned above a thin silver horizontal divider line
|
| Ancient Romance/Palace Intrigue | small elegant dark red traditional text inside a thin golden rectangular border frame with corner decorations
|
| Modern Romance/Sweet Pet | small soft pink-white handwritten text with a tiny heart motif on the left side, light sparkle effect
|
| Mystery/Detective | small pale grey text with slight blur effect, almost hidden in the shadows, a thin cracked line underneath
|
| Sci-Fi/Post-Apocalyptic | small crisp white monospace text with subtle cyan scanline overlay, flanked by small geometric brackets
|
| Western Fantasy | small bronze medieval script text with aged parchment texture, enclosed in a small decorative shield or banner shape
|
| History/Military | small dignified white Song typeface text above a double horizontal line in dark red
|
| Supernatural/Horror | small faded grey-green text slightly tilted, with a thin dripping ink line above
|
| Light Novel | small playful rounded white text with pastel color outline, tiny star decorations on both sides
|
General Rules for Author Name:
- Size: (not too large to steal the title's focus, nor too small to be unreadable)
- Position: , keep appropriate spacing from the bottom of the image
- Must have decorative elements: at least one of lines/borders/small icons/light effects
- Color contrasts with the background but is not harsh
Style Layer: Platform Style
Determine the overall visual style based on the target platform:
| Platform | Style Features | Description Keywords |
|---|
| Tomato Novel | Bright and eye-catching, prominent characters, saturated colors | vibrant saturated colors, eye-catching, bold contrast, popular mass-market style
|
| Qidian | Exquisite and grand, detailed images, realistic leaning | polished refined style, detailed illustration, epic cinematic composition
|
| Jinjiang | Aesthetic and dreamy, soft tones, beautiful characters | dreamy ethereal aesthetic, soft pastel tones, elegant romantic style
|
| Zhihu Yanyan | Minimalist and literary, ample negative space, atmospheric | minimalist literary style, subtle atmosphere, clean composition with negative space
|
| Qimao | Warm and striking, strong impact | striking high-impact, vivid dramatic colors, attention-grabbing
|
| Ciweimao | Anime/Light Novel style | anime illustration style, vibrant colorful, detailed character art
|
Visual Layer: Genre + Composition
Read genre-corresponding style tags, colors, character and background descriptions from references/cover-styles.md.
Composition Variants (suggest 2-3 options for the first attempt):
| Option | Composition | Suitable Genres |
|---|
| A | Character Close-up + Scene | Suitable for all genres |
| B | Full-body Portrait + Dynamic Pose | Xuanhuan, Urban, Western Fantasy |
| C | Pure Scene/Atmosphere Image | Mystery, Sci-Fi, History |
Complete Prompt Template
Chinese web novel cover design, [platform style].
Title text '{书名}' at top center in [book title font style].
Author name '{作者名}' at bottom center in [author name font style — select from the table above].
[genre style tags]. [character description]. [background description].
[color instructions]. [light effect instructions].
Professional book cover, high detail digital painting, portrait 2:3 ratio, no watermark
Prompt Tips (Verified by Practice)
- The more specific the character description, the better: specify every dimension including clothing, posture, hairstyle, expression, props
- Background layering: Foreground (characters) → Middle Ground (scenes) → Background (atmosphere)
- Light effects specify light source direction + color (e.g.,
dramatic golden light from above
)
- Use instead of to avoid a real-person photo feel
Step 3: Call API
Text-to-Image
bash
curl -s "${BASE_URL}/images/generations" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"${MODEL}\",
\"prompt\": \"${PROMPT}\",
\"size\": \"${SIZE}\",
\"response_format\": \"${FORMAT}\"
}" > response.json
# If "Unknown parameter: response_format" is returned, retry without this parameter (not supported by some channels)
Image-to-Image (When there is a reference image)
bash
curl -s "${BASE_URL}/images/edits" \
-H "Authorization: Bearer ${API_KEY}" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"${MODEL}\",
\"prompt\": \"${PROMPT}\",
\"image\": \"${IMAGE_URL}\",
\"size\": \"${SIZE}\",
\"response_format\": \"${FORMAT}\"
}" > response.json
Save Image
bash
mkdir -p "${BOOK_DIR}/封面"
jq -r '.data[0].b64_json' response.json | base64 --decode > "${BOOK_DIR}/封面/封面_v1.png"
Step 4: Quality Check + Iteration
| Check Item | Standard |
|---|
| Text Rendering | Book title is clearly recognizable, font style matches the genre |
| Genre Matching | Visual style is consistent with the book title's genre |
| Reasonable Composition | Subject is prominent, text does not block the core image |
| Platform Adaptation | Conforms to the cover style and tone of the target platform |
If unsatisfied, adjust the direction: change composition, adjust color tone, switch font style, change platform style.
Reference Materials
| File | When to Load |
|---|
| references/cover-styles.md | Genre→visual style mapping, platform style details, prompt templates |
Language
- Reply in Chinese if the user uses Chinese, reply in English if the user uses English
- Follow Chinese Copywriting Guidelines for Chinese replies