Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@xiaokexiang/tgi

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xiaokexiang/tgi

Text Generate Image - 阿里云 DashScope 文生图工具

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

TGI (Text Generate Image)

阿里云 DashScope 文生图 CLI 工具,支持千问(Qwen-Image)和万相(Wan)系列模型。

安装

npm i -g @xiaokexiang/tgi

快速开始

# 设置 API Key
export DASHSCOPE_API_KEY="sk-xxx"
# 或在 ~/.tgi.env 写入 DASHSCOPE_API_KEY=sk-xxx

# 生成图片(默认返回 URL)
tgi --prompt "一只可爱的猫咪"

# 下载到指定目录
tgi --prompt "一只可爱的猫咪" --output ./images

常用命令

# 千问生成(默认模型)
tgi --prompt "夕阳下的海滩" --size 2048*2048

# 万相 4K 生成
tgi --model wan2.7-image-pro --prompt "壮观的山脉" --size 4K

# 显示请求详情
tgi --prompt "一只猫" --wide

# 组图生成
tgi --model wan2.7-image-pro --prompt "小猫的一天" --n 4 --sequential true

参数说明

参数说明
--model模型名称 (默认: qwen-image-2.0-pro)
--prompt正向提示词 (必填)
--negative反向提示词 (千问,默认自动添加)
--size图片尺寸 (如 2048*2048, 4K)
--n生成数量 (默认: 1)
--output输出目录 (可选,默认只返回URL)
--thinking思考模式 (万相,默认开启)
--extendPrompt改写 (千问,简洁时自动开启)
--wide显示请求详情

支持的模型

  • 千问: qwen-image-2.0-pro, qwen-image-2.0-max, qwen-image-2.0, qwen-image-max, qwen-image-plus
  • 万相: wan2.7-image-pro, wan2.7-image, wan2.6-image, wan2.6-t2i, wan2.5-t2i-preview

特性

  • ✨ 智能默认值(简洁 prompt 自动开启改写)
  • 🔒 强参数校验(请求前验证,失败不发送)
  • 🖼️ 万相支持 4K 和组图模式
  • 📝 千问支持反向提示词
  • 🐛 --wide 调试模式

许可证

MIT

Keywords

text-to-image

FAQs

Package last updated on 13 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts