image_generation
Original:🇨🇳 Chinese
Translated
1 scriptsChecked / no sensitive code detected
AI image generation and editing capabilities, implemented based on Nano Banana (Gemini Image) to support text-to-image, image-to-image, and image editing. Suitable for scenarios such as creative design, marketing materials, social media content, and presentation illustrations. Supports multiple styles, high-resolution output (up to 4K), text rendering, and character consistency preservation.
6installs
Sourcehxk622/tokendance
Added on
NPX Install
npx skill4agent add hxk622/tokendance image_generationTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Capability Overview
AI image generation capabilities allow you to:
- Text-to-Image: Generate images based on text descriptions
- Image-to-Image: Generate new images based on reference images
- Image Editing: Modify specific parts of existing images
- Style Transfer: Change image styles (realistic, anime, oil painting, etc.)
- Text Rendering: Generate clear and readable text in images
Powered by Google Gemini's Nano Banana / Nano Banana Pro models.
Workflow
Phase 1: Requirement Understanding
- Understand the user's image requirements (theme, style, usage)
- Confirm output format (dimensions, resolution, quantity)
- If there are reference images, confirm the editing intent
Phase 2: Prompt Construction
- Convert user intent into English prompts (better results)
- Follow the prompt formula:
<subject> <action> <scene> <style> <quality> - Supplement necessary detailed descriptions
Phase 3: Image Generation
- Call the tool
generate_image - Call the tool if editing is needed
edit_image - Generate multiple candidates (for user selection if required)
Phase 4: Delivery
- Display the generated results
- Ask if adjustments are needed
- Save to the user-specified location
Tool Usage
generate_image
- Purpose: Generate images based on text descriptions
- Parameters:
- : Image description (English yields better results)
prompt - : Style presets (realistic, anime, oil_painting, watercolor, minimal, cinematic)
style - : Aspect ratio (1:1, 16:9, 9:16, 4:3, 3:4)
aspect_ratio - : Resolution (1K, 2K, 4K)
resolution - : Number of images to generate (1-4)
num_images
- Example:
python
generate_image( prompt="A majestic horse galloping through cherry blossoms, golden hour lighting, Chinese New Year festive atmosphere", style="realistic", aspect_ratio="16:9", resolution="2K", num_images=2 )
edit_image
- Purpose: Edit existing images
- Parameters:
- : Original image path or URL
image_path - : Editing instructions (e.g., "Change the background to night scene")
prompt - : Whether to keep the subject unchanged (default True)
preserve_subject
- Example:
python
edit_image( image_path="/workspace/photo.jpg", prompt="Add Chinese New Year decorations and red lanterns to the background", preserve_subject=True )
Prompt Best Practices
Basic Formula
[Subject] + [Action/Pose] + [Scene/Background] + [Style] + [Atmosphere/Lighting]Style Keywords
- Realistic: photorealistic, hyperrealistic, 8K, detailed
- Anime: anime style, Ghibli style, cel shading
- Oil Painting: oil painting style, impressionist, Van Gogh style
- Minimalist: minimal, flat design, vector art
- Cinematic: cinematic, dramatic lighting, movie poster style
Quality Enhancement Words
- ,
high quality,detailedsharp focus - ,
professional photographyaward winning - ,
4K resolutionultra detailed
Avoidance Items
- ❌ Avoid vague descriptions: "A nice picture"
- ❌ Avoid contradictory descriptions: "Cartoon in realistic style"
- ❌ Avoid sensitive content
- ✅ Be specific, clear, and layered
Application Scenario Templates
Scenario 1: WeChat Red Envelope Cover/Festival Greeting Image
yaml
prompt_template: |
A {animal} in {pose}, surrounded by {decorations},
Chinese New Year theme, festive red and gold colors,
{style} style, high quality, {text_content}
variables:
animal: "majestic horse" # Year of the Horse
pose: "running gracefully"
decorations: "cherry blossoms, red lanterns, gold coins"
style: "elegant illustration"
text_content: "with Chinese text '恭喜发财' in golden calligraphy"Scenario 2: Presentation Illustration
yaml
prompt_template: |
{concept} visualization, professional infographic style,
clean white background, modern corporate aesthetic,
subtle gradients, minimalist design
variables:
concept: "AI workflow automation"Scenario 3: Social Media Content
yaml
prompt_template: |
{subject} {action}, {platform} optimized aspect ratio,
vibrant colors, eye-catching composition,
trending aesthetic, shareable content style
variables:
subject: "coffee cup"
action: "with steam rising"
platform: "Instagram" # 1:1 or 4:5Output Format
Generated Result Display
markdown
## 🎨 Image Generation Completed
**Prompt**: [English prompt used]
**Parameters**:
- Style: [style]
- Aspect Ratio: [aspect_ratio]
- Resolution: [resolution]
**Generated Results**:

**Next Steps**:
- [ ] Satisfied, save to specified location
- [ ] Need to adjust style/color
- [ ] Need to modify specific parts
- [ ] RegenerateNotes
- Copyright Compliance: Generated images have SynthID watermarks
- Content Policy: Comply with Google's usage policies, do not generate sensitive content
- Commercial Use: Supports commercial use (marketing, products)
- Text Rendering: Nano Banana Pro supports multilingual text, but Chinese effects need verification
- Character Consistency: Maintaining character features across images requires using the reference image function
Resource References
- - Preset prompt templates
resources/prompt_templates.yaml - - Detailed style presets
resources/style_presets.md - - Year of the Horse exclusive templates
resources/chinese_new_year_2026.md