import dotenv from 'dotenv'; import util from 'node:util'; dotenv.config({ path: '.env' }); import { QwenText2Image } from '../../src/dashscope/dashscope.ts'; const main = async () => { // 1. create image const qwen = new QwenText2Image(process.env.BAILIAN_API_KEY || ''); const res = await qwen.queryImage({ model: 'wan2.2-t2i-flash', input: { prompt: '一个可爱的小的熊猫,卡通风格,抱着竹子。周边有很多彩色的气球。', }, }); console.log('create image response:', util.inspect(res, { depth: null, colors: true })); } main() // create image response: { // request_id: '6b8d3e4d-0b1a-4a01-bcc9-826336e4267a', // output: { // task_id: '3318eb1d-cd5d-4408-a9bb-6cddd7967a43', // task_status: 'SUCCEEDED', // submit_time: '2025-09-15 19:37:22.177', // scheduled_time: '2025-09-15 19:37:22.228', // end_time: '2025-09-15 19:37:28.802', // results: [ // { // orig_prompt: '一个可爱的小的熊猫,卡通风格,抱着竹子。周边有很多彩色的气球。', // actual_prompt: '卡通风格的可爱小熊猫,圆润造型,毛茸茸的白色身体与黑色斑纹分明,抱着翠绿竹子,周围漂浮着五彩缤纷的圆形气球,背景为浅蓝色天空与几缕白云,画面明亮温馨,适合儿童插画,采用柔和线条与饱满色彩,仰视视角增强萌态。', // url: 'https://dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com/1d/2d/20250915/5020e443/3318eb1d-cd5d-4408-a9bb-6cddd7967a432353322002.png?Expires=1758022648&OSSAccessKeyId=LTAI5tKPD3TMqf2Lna1fASuh&Signature=8EkJ7ccUsKlZHfU6y3Iiog3fjSQ%3D' // } // ], // task_metrics: { TOTAL: 1, SUCCEEDED: 1, FAILED: 0 } // }, // usage: { image_count: 1 } // }