wanx-img
13
总安装量
7
周安装量
#24736
全站排名
安装命令
npx skills add https://github.com/mebusw/wanx-img --skill wanx-img
Agent 安装分布
claude-code
6
opencode
5
trae
3
antigravity
3
codex
3
Skill 文档
Overview
This skill provides commands for generating and editing images using the WanX model from Alibaba.
Workflow
- decide user’s intent: whether to generate a new image, or edit given images
- decide which version of visual LLM will be used, use the highest version by default, if it’s not availiable or rejected by provider, then downgrade to other version
- if user provides images urls/paths, you don’t need to read the files but only pass them to scripts
- if user specify size of image in pixel number, pass it to scripts, or if user specify aspect ratio, convert it to image size and then pass to scripts
- run a proper script to generate or edit images with user input prompt, synchronously by default
- output original prompts, extended actual prompts, size of image, and full urls of generated images (don’t miss any parameters from the url for example Signature etc. )
Conversion between ratio and image size
The total number of pixels must be between [12801280, 14401440] and the aspect ratio must be between [1:4, 4:1]. For example, 7682700 meets the requirements. The default value is 12801280.
| aspect ratio | image size |
|---|---|
| 1:1 | 1280*1280 |
| 3:4 | 1104*1472 |
| 4:3 | 1472*1104 |
| 9:16 | 960*1696 |
| 16:9 | 1696*960 |
Available Scripts
wanx2.6-text-to-image-v2-demo.py– Generate images from text prompts, using WanX visual model version 2.6wanx2.6-image-edit-demo.py– Edit images with text prompts, optionally with reference/mask images, using WanX visual model version 2.6wanx2.5-text-to-image-v2-demo.py– Generate images from text prompts, using WanX visual model version 2.5wanx2.5-image-edit-demo.py– Edit images with text prompts, optionally with reference/mask images, using WanX visual model version 2.5wanx2.2-text-to-image-v2-demo.py– Generate images from text prompts, using WanX visual model version 2.2
Setting Up
馿¬¡ä½¿ç¨æ¶ï¼è¿å ¥ç®å½å¹¶å®è£ ä¾èµï¼
cd ~/.claude/skills/wanx-img
python3 -m venv py312-ai-rag
source py312-ai-rag/bin/activate
pip install dashscope python-dotenv argparse
cp .env.example .env
åç»æ§è¡pythonèæ¬æ¶ï¼å
æ§è¡source py312-ai-rag/bin/activateï¼ç¶ååæ§è¡èæ¬ã妿pythonæpython3å½ä»¤æ¾ä¸å°åéçpackagesï¼ååºç¨~/.pyenv/versions/py312-ai-rag/bin/pythonæ¥æ¿ä»£ä½ä¸ºæ§è¡å¨ã
Usage Examples
- Use custom prompt to generate image
~/.pyenv/versions/py312-ai-rag/bin/python "./scripts/wanx2.6-text-to-image-v2-demo.py" --prompt "ä¸åªå¯ç±çç«åªå¨è±åéç©è. ar 3:4" --size "960*1280"
- Use synchronous call with custom prompt and negative prompt to generate image
~/.pyenv/versions/py312-ai-rag/bin/python "./scripts/wanx2.6-text-to-image-v2-demo.py" -p "ç¾ä¸½çæ¥è½é£æ¯" -n "人ç©" --sync
- Use custom prompt and referencing images to edit image
~/.pyenv/versions/py312-ai-rag/bin/python "./scripts/wanx2.6-image-edit-demo.py" --prompt "åèå¾1ç飿 ¼åå¾2çèæ¯ï¼çæçªèçè" --images http://1.img http://2.img -m http://3.img -b http://4.img
- Use synchronous call with custom prompt to edit iamge
~/.pyenv/versions/py312-ai-rag/bin/python "./scripts/wanx2.6-image-edit-demo.py" -p "åèå¾1ç飿 ¼åå¾2çèæ¯ï¼çæçªèçè" --sync
Requirements
- Python 3.12+
- LLM API credentials configured in demo scripts
- DashScope Python SDK 1.25.8+