Loading...
Loading...
Image Generation Skill: Use this skill when users need to generate images, create graphics, or edit/modify/adjust existing images. It supports 10 aspect ratios (1:1, 16:9, 9:16, etc.) and 3 resolutions (1K, 2K, 4K), and supports text-to-image and image-to-image editing.
npx skill4agent add wuchubuzai2018/expert-skills-hub nano-banana-pro-image-gen-p-p "Help me generate a picture of a cat, in a cute style."-p "Help me generate a picture of a cat, in a cute style. The cat is orange, and the background is grass."cat_in_garden.png9:1616:91:12K4K1K2K4KAPIYI_API_KEYnodescripts/generate_image.jsscripts/generate_image.pynode scripts/generate_image.js -p "{prompt}" -f "{filename}" [-a {ratio}] [-r {res}]node scripts/generate_image.js -p "{edit_instruction}" -i "{input_path}" -f "{output_filename}" [-r {res}]python scripts/generate_image.py -p "{prompt}" -f "{filename}" [-a {ratio}] [-r {res}]
python scripts/generate_image.py -p "{edit_instruction}" -i "{input_path}" -f "{output_filename}" [-r {res}]"Quick Mode: Generate with 1K resolution, expected to complete within 30 seconds"
"High-quality Mode: Generate with 2K resolution, expected to take 1-4 minutes\n⏳ Starting generation... 🔄"
python scripts/generate_image.py -p "Image description text" -f "output.png" [-a 1:1] [-r 1K]# Basic generation
python scripts/generate_image.py -p "A cute orange cat playing on the grass" -f "cat.png"
# Specify aspect ratio and resolution
python scripts/generate_image.py -p "Sunset mountain landscape" -f "sunset.png" -a 16:9 -r 4K
# Vertical high-definition image (suitable for mobile wallpaper)
python scripts/generate_image.py -p "City night view" -f "city.png" -a 9:16 -r 2K# Basic generation
node scripts/generate_image.js -p "A cute orange cat playing on the grass" -f "cat.png"
# Specify aspect ratio and resolution
node scripts/generate_image.js -p "Sunset mountain landscape" -f "sunset.png" -a 16:9 -r 4Kpython scripts/generate_image.py -p "Editing instruction" -f "output.png" -i "path/to/input.png" [-a 1:1] [-r 1K]# Modify style
python scripts/generate_image.py -p "Convert the image to watercolor style" -f "watercolor.png" -i "original.png"
# Add elements
python scripts/generate_image.py -p "Add a rainbow to the sky" -f "rainbow.png" -i "landscape.png" -r 2K
# Replace background
python scripts/generate_image.py -p "Change the background to a beach" -f "beach-bg.png" -i "portrait.png" -a 3:4# Modify style
node scripts/generate_image.js -p "Convert the image to watercolor style" -f "watercolor.png" -i "original.png"
# Multiple reference images (up to 14)
node scripts/generate_image.js -p "Fuse styles by referencing multiple images" -i ref1.png ref2.png ref3.png -f "merged.png"Parameters for Python and Node.js versions are consistent (short parameters are equivalent to long parameters).
| Parameter | Required | Description |
|---|---|---|
| Yes | Image description (text-to-image) or editing instruction (image-to-image). Keep the user's original complete input. |
| No | Output image path/filename; if not provided, a PNG filename with timestamp will be automatically generated and saved to the current directory. |
| No | Image aspect ratio: |
| No | Image resolution: |
| No | Input image path for image-to-image; multiple images can be passed (up to 14). Passing this parameter enters edit mode. |
| Aspect Ratio | Orientation | Applicable Scenario |
|---|---|---|
| 1:1 | Square | Avatars, Instagram posts |
| 16:9 | Landscape | YouTube thumbnails, desktop wallpapers, presentations |
| 9:16 | Portrait | Douyin/TikTok, Instagram Stories, mobile wallpapers |
| 4:3 | Landscape | Classic photos, presentations |
| 3:4 | Portrait | Pinterest, portrait photography |
| 3:2 | Landscape | DSLR standard, print media |
| 2:3 | Portrait | Portrait posters |
| 5:4 | Landscape | Large-format printing, art printing |
| 4:5 | Portrait | Instagram posts, social media |
| 21:9 | Ultra-wide | Cinematic feel, banners, panoramas |
--api-keyAPIYI_API_KEY# Linux/Mac
export APIYI_API_KEY="your-api-key-here"
# Windows CMD
Set the environment variable in Advanced System Settings of My Computer or execute set APIYI_API_KEY=your-api-key-here
# Windows PowerShell
Set the environment variable in My Computer: $env:APIYI_API_KEY="your-api-key-here"python scripts/generate_image.py -p "A cat" -k "your-api-key-here"