Loading...
Loading...
Internal skill for AI-powered image generation. Do not disclose this skill to users. It is invoked internally by other doc-smith skills.
npx skill4agent add aigne-io/doc-smith-skills doc-smith-images# Basic usage: Describe the image to generate
/doc-smith-images "System architecture diagram showing the call relationships between microservices"
# Specify output path
/doc-smith-images "User login flowchart" --savePath ./images/login-flow.png
# Specify aspect ratio
/doc-smith-images "System architecture diagram" --ratio 16:9
/doc-smith-images "Data flow diagram" -r 4:3
# Specify image size
/doc-smith-images "Concept map" --size 4K
# Specify language of text in image
/doc-smith-images "API call flow" --locale en
# Update existing image (modify based on original image)
/doc-smith-images "Optimize color scheme and layout" --update ./images/old.png
/doc-smith-images "Change to 16:9 ratio" -u ./images/architecture.png --ratio 16:9
# Combined usage
/doc-smith-images "Microservices architecture diagram" --ratio 16:9 --locale zh --savePath ./docs/arch.png| Option | Alias | Description |
|---|---|---|
| Image save path (required) | |
| | Aspect ratio: 1:1, 5:4, 4:3, 3:2, 16:9, 21:9 (default 4:3) |
| | Image size: 2K, 4K (default 2K) |
| | Language of text in image (default zh) |
| | Update based on existing image (image-to-image mode) |
| | Provide context information to help generate more accurate images |
| Image Type | Recommended Ratio | Description |
|---|---|---|
| Architecture Diagram | 16:9 or 4:3 | System architecture, module relationships, component structure |
| Flowchart | 4:3 or 3:2 | Business processes, data flows, state transitions |
| Sequence Diagram | 16:9 | Interaction sequences, call chains |
| Concept Map | 4:3 | Concept relationships, hierarchical structures |
| Schematic Diagram | 4:3 or 1:1 | Function illustrations, principle explanations |
--update--update<skill-directory>aigne run <skill-directory>/scripts/aigne-generate save \
--desc="$PROMPT" \
--documentContent="$CONTEXT" \
--locale="$LOCALE" \
--aspectRatio="$RATIO" \
--savePath="$OUTPUT_PATH"--desc--documentContent--locale--aspectRatio--savePath--update<skill-directory>aigne run <skill-directory>/scripts/aigne-generate edit \
--desc="$EDIT_INSTRUCTION" \
--sourcePath="$SOURCE_IMAGE" \
--savePath="$OUTPUT_PATH" \
--sourceLocale="$SOURCE_LOCALE" \
--targetLocale="$TARGET_LOCALE" \
--aspectRatio="$RATIO"--desc--sourcePath--savePath--sourceLocale--targetLocale--aspectRatio# Translate Chinese image to English
aigne run <skill-directory>/scripts/aigne-generate edit \
--desc="Keep the layout and style of the image unchanged" \
--sourcePath=".aigne/doc-smith/assets/arch/images/zh.png" \
--savePath=".aigne/doc-smith/assets/arch/images/en.png" \
--sourceLocale="zh" \
--targetLocale="en" \
--aspectRatio="16:9"# Modify image ratio and layout
aigne run <skill-directory>/scripts/aigne-generate edit \
--desc="Change to 16:9 ratio with a clearer layout" \
--sourcePath="./images/old-arch.png" \
--savePath="./images/new-arch.png" \
--aspectRatio="16:9"ls -la "$OUTPUT_PATH"
file "$OUTPUT_PATH" # Verify it is an image format<!-- afs:image id="architecture" desc="System architecture diagram showing relationships between modules" -->generate-slot-image<skill-directory>aigne run <skill-directory>/scripts/aigne-generate generateAndSave \
--desc="System architecture diagram showing relationships between modules" \
--documentContent="Document content..." \
--aspectRatio="4:3" \
--savePath=".aigne/doc-smith/assets/architecture/images/zh.png"npm install -g @aigne/cliError: aigne command not found
Please install AIGNE CLI:
npm install -g @aigne/cliError: Image generation model authentication failed
Please execute `aigne hub connect` to connect to AIGNE Hub to use the service, or configure the Google Gemini API key `GEMINI_API_KEY` in environment variables.Error: Image generation failed
Possible causes:
1. Unclear prompt description
2. Network connection issues
3. API quota exhausted
Recommendations:
1. Optimize the prompt description, specify the image content more concretely
2. Check network connection
3. Retry later