Skip to main content
图片生成与编辑

文本生成图像

通过文生图API,您可以基于文本描述创造出全新的图像。阿里云百炼提供万相(Wan)、千问(Qwen-Image)和z-image系列模型。

在线体验新加坡北京 在线体验提供无需编程的网页版文生图功能,在页面中输入文本描述即可直接生成图像:
  • 模型体验中心:点击上方的在线体验链接(新加坡北京)进入,可选择模型、设置输出分辨率、开启智能改写后直接提交生成。
如需在自有应用中集成文生图能力,请使用下方的 API 调用方式。

模型效果

千问(Qwen-image)

复杂布局

9cea00ec-c9bf-9f35-909b-0d8c7b03f6a6_qwen_image3_serving_output_0-2026-08-06-20-13-11

长段落

e03efee1-35b1-9109-a988-e3977add0fac_qwen_image3_serving_output_0

写实人像

2beecb7f-c3c3-9c10-9458-04325512bb8a_qwen_image3_serving_output_0

UI设计

image (92)

PPT

image (90)

插画设计

e38cc145-78f6-92a7-9bdb-141be17dba04_qwen_image3_serving_output_0

复杂布局
Create a 16:9 wide horizontal e-commerce storefront hero banner infographic for “TodoTi,” a Mexican-inspired colorful lifestyle brand. The design should look like a professional online shop header for desktop and tablet, with clear visual hierarchy, festive marketing energy, and readable English typography.

Background: vibrant Mexican folk color palette of bright yellow, warm red, peacock blue, and emerald green, blended with soft watercolor washes, subtle handmade paper texture, and fine grain. The top and bottom edges are decorated with traditional papel picado cut-paper banners made of repeating diamonds, triangles, and wave shapes in alternating yellow, red, green, and purple. The papel picado should look light and gently fluttering, with cut-out areas revealing a deep starry-night blue background. Below the top papel picado and above the bottom papel picado, add a continuous Aztec geometric border of stepped lines and diamond motifs in white and antique gold.

Four corners: add small 3D decorative Talavera ceramic pots with blue-and-white floral patterns, glossy glaze highlights, and miniature potted cacti with rich green texture and fine spines. These corner elements should balance the composition and add handcrafted detail.

Left third: brand identity zone. Feature a large 3D wordmark “TodoTi.” The letter “T” extends into two green cactus pads with clear vein texture; the letter “o” contains a red-and-yellow sunburst with sixteen thin rays; the curve of the letter “d” is decorated with blue-and-white Talavera ceramic patterns featuring three peonies and winding vines; the dot of the letter “i” is a glossy red cherry tomato with a white highlight. The wordmark has bold black outlines, high-saturation gradient fills, and a soft drop shadow.

Below the wordmark, place the slogan: “TodoTi — Your Colorful Lifestyle Hub.” The slogan is in rounded bold white sans-serif with a subtle red glow, centered and highly legible. Below it, add a smaller handwritten-style subtitle in bright yellow: “Mexican-inspired warmth to brighten every day.”

Behind the wordmark, add a faint semi-circular Aztec sun calendar relief in antique gold and bronze, with fine geometric patterns and a stylized face motif featuring diamond eyes and a rectangular mouth. The relief should glow softly with warm golden light. On the left edge, stack three small circular badges with peacock-blue backgrounds, white text, and stitched dashed borders: “Curated Picks,” “Direct Sourcing,” and “Thoughtful Service.”

Center-left: a cheerful Mexican folk-art lifestyle illustration. A cute Catrina skeleton girl wears a wide straw sombrero with red-and-green woven tassels and a colorful embroidered poncho in warm red and peacock blue. Her poncho is decorated with Aztec geometric patterns and blooming marigolds with radiating petals. Her face has elegant Day of the Dead makeup: black heart-shaped eye details with white dashed outlines, red rose cheek motifs, and a warm friendly smile. She pushes a vintage wooden cart with mosaic-tile wheels in blue, white, yellow, and green.

The cart is filled with clearly visible everyday products with small clean English labels. Include a Talavera ceramic mug labeled “Talavera Ceramic Mug — Heat-resistant, underglaze art, 350ml”; a handwoven sisal basket labeled “Handwoven Basket — Natural sisal, sturdy, 30x20x15cm”; a green cactus-shaped scented candle with a soft flame labeled “Cactus Candle — Plant essential oil, calming, 40-hour burn”; and colorful Mexican throw pillows labeled “Mexican Pillow — Cotton-linen, removable cover, 45x45cm.” The illustration background is a sunny desert oasis with real cacti, soft clouds, warm side-backlight, and a thin golden rim light on the illustrated elements.

Center-right: product category navigation in a 2x2 grid of rounded rectangle cards with even spacing, 15px rounded corners, and subtle paper texture. Card 1, red background, title “Home Textiles” in bold white, with a flat icon of a woven wall tapestry with tassels; body text: “Rugs, pillows, tablecloths, curtains. Premium cotton-linen with vivid colors that bring Mexican warmth home.” Card 2, peacock-blue background, title “Kitchen & Dining” in bold white, with a Talavera ceramic plate icon; body text in bright yellow: “Bowls, cups, tableware, storage. Handcrafted ceramic texture makes every meal feel special.” Card 3, bright yellow background, title “Bath & Care” in bold dark brown, with a cactus-shaped soap dish icon; body text in dark brown: “Towels, soap dishes, toothbrush cups, shelves. Water-resistant materials for a fresh, relaxing bath space.” Card 4, emerald-green background, title “Lifestyle Goods” in bold white, with a colorful pinwheel icon; body text in white: “Hangers, hooks, tissue boxes, trash bins. Practical, beautiful details that elevate daily living.”

Right side: promotional zone shaped like a large Mexican mariachi guitar. The guitar body is warm wood with red-and-gold floral vine carvings, the neck extends upward, and the strings are silvery with a metallic shine. Inside the guitar body, place the main promotion. At the top, add a red ribbon banner with white bold text: “TodoTi Grand Opening Fiesta.” Below it, display a large offer: “Spend $199, Save $50,” with “Spend” and “Save” in white medium text and the numbers in oversized yellow-and-red 3D type. Below the offer, add smaller handwritten white text: “New customers: $20 off first order + free shipping.”

At the bottom of the guitar body, place three small circular badges with dark blue backgrounds, white text, and thin gold outlines: “7-Day Easy Returns,” “Fast Shipping,” and “Authentic Quality.” From the guitar neck, let several colorful ribbons flow outward with tilted text: “Now through the end of the month.”

Bottom area: brand story and culture zone against a deep blue night sky with glowing white five-pointed stars and black cactus silhouettes. On the left, place a title block: “About TodoTi” in bold white with a soft yellow glow. To the right, create three equal columns. Column 1 heading in bright yellow with a white underline: “Design Philosophy”; body in light gray-white: “TodoTi brings the color and craft of Mexican folk art into modern home essentials, blending Aztec motifs and Talavera patterns with everyday practicality.” Column 2 heading: “Quality Promise”; body: “We carefully select trusted global suppliers and test every product for safe, durable, and eco-friendly quality.” Column 3 heading: “Lifestyle Philosophy”; body: “Life is better in color. TodoTi helps you celebrate daily moments with warmth, joy, and vibrant Mexican-inspired energy.”

Very bottom: a slim interactive guidance bar above the Aztec border. Use a translucent frosted-white background with a soft blur. Left side: “Get more home inspiration from @TodoTiOfficial” in dark brown, aligned with a small official badge icon. Center: a white rounded search box with a magnifying-glass icon and placeholder text: “Search everyday essentials and start a colorful life” in warm red. Right side: a headset customer-service icon with dark brown text: “Questions? Customer Care: 400-888-TODO | 9:00–22:00.”

Overall style: vibrant, festive, handcrafted, authentic Mexican-inspired e-commerce banner, modern retail marketing layout, balanced composition, clean information hierarchy, high readability, warm lighting, rich details, professional storefront hero image. All on-image text must be in English only, with no Chinese characters, no misspellings, and clean legible typography.
超长段落
Vertical Western European 19th-century illustrated poetry page, Romantic maritime farewell theme, international English visual tradition, not an East Asian painting. The composition is a vertical art print or vintage book page with aged ivory paper, fine engraved linework, muted blue-gray watercolor washes, and elegant negative space. The main feature is a long English poem rendered clearly in elegant English copperplate-inspired calligraphy, highly legible, English alphabet only, standard left-to-right reading order, top-to-bottom layout, correct punctuation, exact line breaks, natural ink pressure, dark sepia-black lettering, subtle vintage letterpress texture, refined international typography.

Below and around the text, illustrate a cold twilight seashore: gray stones beside the sea, a small boat floating near the shore, distant ships moving toward a haven under low hills, pale evening mist over the water, faint moonlight, soft ripples, a lonely coastal atmosphere, melancholic but restrained. The mood is poetic, timeless, and elegant, like a Victorian English maritime lyric. No Chinese characters, no Chinese painting style, no seals, no stamps, no modern objects, no illegible glyphs, no random letters.

Render exactly the following 12 lines from Alfred, Lord Tennyson's public-domain poem “Break, Break, Break”; do not render the title or author name:

Break, break, break,
On thy cold gray stones, O Sea!
And I would that my tongue could utter
The thoughts that arise in me.
O well for the fisherman's boy,
That he shouts with his sister at play!
O well for the sailor lad,
That he sings in his boat on the bay!
And the stately ships go on
To their haven under the hill;
But O for the touch of a vanish'd hand,
And the sound of a voice that is still.

High resolution, masterful long-form English text rendering, poetic, elegant, museum-quality Western illustrated book page.
写实人像
帮我生成一张生活化美食男生人像写真,呈现实拍电影质感。画面主体是一位24岁左右的年轻男生,五官清爽干净,眉眼温和,皮肤自然清透,保留真实的肤质细节。他穿着质地柔软的米白色粗棒针织毛衣,内搭纯白T恤微微露出领口,展现出温暖、精致且松弛的生活气息。人物坐在温馨的西餐厅餐桌前,身体微微前倾,右手握着银质刀叉正在轻轻切开盘中的惠灵顿牛排,左手自然轻扶着桌面边缘。他微微侧头看向镜头,嘴角带着若有似无的松弛浅笑,眼神温柔且带有生活感。木质桌面上摆满了精致的西餐餐食,旁边有装着琥珀色饮品的复古高脚杯和一小瓶淡雅的复古插花。人物身后是通透的玻璃墙面,上面印有浅金色的法文手写体菜单“Menu du Jour”,文字以丝印工艺自然贴合在玻璃表面,并带有轻微的环境反光。环境采用暖黄色室内顶光,光线柔和地洒在人物面部和桌面食物上,食物表面泛着诱人的高光,背景玻璃透出室外微弱的冷色环境光,形成电影感十足的冷暖光影对比。采用近距离平视取景,机位略带侧前方的呼吸感,避免死板居中,小景深让背景的玻璃墙面和餐厅环境轻微虚化,形成温暖的散景光斑,前景的插花和饮品边缘也带有自然的虚化过渡,整体色调温暖治愈,充满浓郁的生活氛围与美食诱惑。
UI设计
这张图片是一款沉浸式亚洲雨林声音探索体验网站的宽屏电脑端界面设计,整体氛围暗沉静谧,设计灵感源自老式野外录音设备与模拟科学仪器。整体配色以深邃祖母绿、浓郁黑曜石黑与柔和大地棕为主,营造出安宁沉静的氛围。界面搭载细微水汽与薄雾特效,柔和斑驳的光影折射效果模拟阳光穿透茂密树冠的景象,背景融入纸张细纹、叶脉等自然肌理。整体画面写实度极高,风格对标英国广播公司高端自然纪实纪录片,构图富有电影质感,渲染细节极致精细。
页面最顶端横贯一整条极简半透明导航栏。最左侧为品牌标识,由精致线条绘制的老式模拟麦克风与龟背竹叶交织而成,搭配柔和米奶油色优雅衬线字体文字“RAINFOREST ARCHIVE”。导航栏右侧是导航菜单,包含四个极简文字链接,字体与颜色和品牌名保持一致:“Expeditions”、“Species”、“Field Notes”、“About”。
页面上三分之二区域为主视觉横幅板块。背景是一张画质超清、氛围感浓郁的古老亚洲龙脑香科雨林实景图,林间萦绕着轻柔绵延的薄雾;前景虚化的深绿色蕨类枝叶形成自然暗角。横幅板块左侧叠加主标题,采用大号高对比度精致衬线字体,文字为“Voices of the
Canopy”。标题正下方是字号更小、质感雅致的副标题,浅米奶油色,内容为“An auditory journey through the ancient
dipterocarp forests of Southeast Asia.”。文字带有轻微打字机质感,字符排布存在细微自然错落,强化复古模拟设备的复古氛围。
横幅板块中下位置是核心音频交互组件:一台复刻老式野外模拟录音机的精密播放器,原型为经典纳格拉或马兰茨磁带机。播放器机身采用拉丝深枪灰色金属材质,带有细微自然划痕与使用磨损痕迹;配有两个大型滚花金属旋钮,旋钮上印有小巧清晰的无衬线刻印文字“GAIN”与“MONITOR”。设备中央是经典音量表,内置温润柔和的琥珀色背光,表内指针轻靠零刻度位置。音量表右侧设有重型实体拨动开关,拨至上方代表“PLAY”播放状态。音频播放时,音量表向外缓缓扩散出同心波纹特效,形似轻柔水纹或细微声波,采用半透明雾绿色调,与薄雾背景自然融合。
横幅板块下方,页面布局切换为简约纪实风网格,用作声音素材库区域。板块顶部配有精致小型标题,全大写字母加宽字距排版,文字为“CURRENT EXPEDITIONS”。标题下方采用规整双栏网格,陈列四张风格各异的声景卡片。
左上第一张卡片:背景是氛围感暗沉的薄雾河岸缩略图,标题文字“Dawn Chorus in Danum Valley”,下方标注信息“Location: Sabah, Borneo”、“Duration: 42:15”,卡片右侧配有一枚小巧琥珀色标识,标注“Currently Playing”。
右上第二张卡片:画面为湿润宽大绿叶特写,标题文字“Monsoon Rain on Broadleaves”,标注信息“Location: Khao Yai, Thailand”、“Duration: 1:15:30”,附带细线条边框按钮,文字“Listen”。
左下第三张卡片:画面是黄昏时分森林树冠朦胧剪影,标题文字“Nocturnal Gibbon Calls”,标注信息“Location: Khao Sok, Thailand”、“Duration: 58:02”,附带细线条边框按钮,文字“Listen”。
右下第四张卡片:画面为树皮纹理微距特写,标题文字“Hornbill Wingbeats”,标注信息“Location: Taman Negara, Malaysia”、“Duration: 24:40”,附带细线条边框按钮,文字“Listen”。
声景网格最右侧,纵向贯穿该下半区域的竖版面板,设计复刻老式野外科学记录本内页。纸张带有柔和复古米黄肌理,页面右下角留有淡咖啡渍痕迹。面板标题采用打字机等宽字体,文字“FIELD NOTES”;正文墨水色调雅致、微微褪色,内容为:
“Recorded using
parabolic microphones
and Nagra IV-S
tape recorders.
Humidity: 94%
Temp: 24°C”
文字旁配有深棕乌墨手绘精致猪笼草植物速写。
页面最底端是极简页脚,整页宽度贯通,上方设有一条细深绿色分隔线。页脚左侧文字“Copyright 2024 Rainforest Archive”,右侧文字“Funded by the Wildlife Conservation Society”,两处文字均采用柔和低调的精致小号衬线字体。
PPT制作:
这是一张宽高比为 16:9 的专业教育类 PPT 幻灯片,整体背景采用极淡的蓝灰色柔和渐变,叠加有极低透明度的正弦波暗纹与微弱的网格点阵纹理,营造出严谨的物理学术氛围与科技感。画面顶部居中位置是主标题区域,文字为巨大的深藏青色无衬线粗体“AC Circuit Anaysis: Resistor with Sinusoidal Voltage”,标题下方紧贴一条明亮的橙色细横线作为视觉分割,横线两端带有微小的圆形端点装饰,增强版式的仪式感。画面主体分为左右两列,采用严谨的栅格对齐系统,左右两列宽度比例约为 1:1.2,确保右侧复杂的公式计算拥有充足的展示空间。左侧列顶部是一个圆角矩形橙色标题栏,内部居中显示白色加粗文字“PROBLEM DATA & WAVEFORM”,标题栏底部带有轻微的投影,使其具有浮起的立体质感。橙色标题栏下方是一个浅灰白色的圆角数据卡片,卡片边缘有极细的浅蓝色边框,内部垂直排列四个数据要点,每个要点左侧配有纯灰色的极简线性图标,依次为电阻符号、波浪线、电压箭头和时钟符号。四个要点的文字采用深灰色清晰字体,依次为“Resistor (R) = 10 Ω”、“Waveform = Sinusoidal”、“Peak Voltage (V subscript p) = 311 V”、“Period (T) = 0.02 s”,文字排版整齐,行距舒适,关键数字使用稍深的颜色进行视觉强调。数据卡片下方是图表区域,顶部居中显示深灰色图表标题“Voltage vs. Time”。图表主体是一个带有浅灰色网格线的二维坐标系,垂直 Y 轴左侧标有深灰色文字“Voltage (V)”,刻度线旁分别标有白色背景框包裹的深蓝色文字“+311”、“0”和“-311”。水平 X 轴下方标有深灰色文字“Time (s)”,刻度线旁标有“0.01”和“0.02”。坐标系中央绘制了一条平滑、饱满且带有轻微发光效果的鲜红色正弦波曲线,曲线线条粗细适中,展现出完美的周期性。在正弦波的波峰处,有一条深蓝色的垂直双向箭头指示振幅,箭头旁标有深蓝色文字“V subscript p = 311 V”。在 X 轴的一个完整周期上方,有一条深蓝色的水平尺寸标注线,两端带有垂直引出线,中间标有深蓝色文字“T = 0.02 s”。图表区域整体留白充足,视觉焦点集中在红色波形上。右侧列顶部同样是一个圆角矩形橙色标题栏,与左侧标题栏高度对齐,内部居中显示白色加粗文字“SOLUTION STEPS & CALCULATIONS”。橙色标题栏下方垂直排列四个浅蓝色渐变的圆角卡片,卡片之间保持均匀的垂直间距,内部留有充足的呼吸空间。第一个卡片左上角有一个深蓝色的圆形编号徽章,内部显示白色数字“1”。卡片标题为深蓝色加粗文字“1. Maximum Current (I subscript p)”。下方正文分为三行,采用标准数学公式的视觉样式排版,呈现为分数线、上下标和根号的优雅形态,文字内容为深灰色“Formula: Ohm’s Law, I subscript p = V subscript p over R”,接着是计算过程“I subscript p = 311 V over 10 Ω = 31.1 A”。卡片右下角有一个亮黄色底色的圆角高亮框,内部显示加粗的深蓝色文字“I subscript p = 31.1 A”。第二个卡片左上角编号徽章显示“2”,标题为“2. AC Voltmeter Reading (V subscript rms)”。正文包含说明“Voltmeters read RMS value.”,公式“V subscript rms = V subscript p over square root of 2”,以及计算“V subscript rms = 311 V over 1.414 ≈ 220 V”,右下角高亮框显示“V subscript rms ≈ 220 V”。第三个卡片编号徽章显示“3”,标题为“3. Actual Power Dissipated (P subscript avg)”。正文包含“Using RMS values.”,公式“P subscript avg = (V subscript rms) squared over R”,计算过程“P subscript avg = (220 V) squared over 10 Ω = 48400 over 10 W = 4840 W”,右下角高亮框显示“P subscript avg = 4.84 kW”。第四个卡片编号徽章显示“4”,标题为“4. Joule Heat in Half Cycle (Q subscript half)”。正文包含“Energy = Power × Time”,时间计算“Time = T over 2 = 0.01 s”,主计算“Q subscript half = P subscript avg × (0.01 s) = 4840 W × 0.01 s = 48.4 J”,右下角高亮框显示“Q subscript half = 48.4 J”。四个卡片的高亮框统一位于右下角,形成整齐的视觉对齐与阅读动线。画面最底部是一条极细的浅灰色横向分隔线,分隔线下方居中显示浅灰色小号无衬线字体“Experimental Physics - AC Circuits Analysis Module”。页脚区域保持极简,其余背景保持纯图形与留白。整张幻灯片色彩系统以深藏青、亮橙色、浅蓝灰和纯白为主,红色波形与黄色高亮框作为视觉点缀,打破了单调,提升了画面的活力与专业度。所有文字边缘锐利,对比度极高,确保在投影或屏幕上清晰可读。光影处理克制,仅通过卡片底部的微弱投影和标题栏的轻微高光来增强层次感,整体呈现出高度成熟、结构清晰、信息饱满的专业物理教学课件质感。
插画设计:
这幅画作以柔和的米白色水彩纸为底,呈现一幅手绘水彩插图。纸张表面展现出传统植物艺术的特征,包括清晰可见的颜料颗粒和湿画法带来的柔和色彩晕染。画面上方中央区域绘有一簇簇紫罗兰和三色堇。花瓣由淡紫色、深紫色和淡紫色渐变交织而成,花心呈金黄色。花朵旁点缀着一片翠绿色的小叶,以半透明的水彩晕染和精细的叶脉刻画而成。柔和的定向光线照亮画面,突显了水彩纸的质感和颜料的微妙变化。在花卉图案正下方,纸张下半部分水平居中的位置,是“Виолета”字样。该字样以弧形书法体书写,并使用了金属金色墨水。字母造型采用流畅、连续的笔画,并略带浮雕立体感,在光线照射下呈现出柔和的金属光泽。

万相

人像写真

p1023523-转换自-png

写实摄影

p1023409-转换自-png

绘画流派

p1023526-转换自-png

文字生成

p1023535-转换自-png

海报设计

p1023546-转换自-png

组图生成

p1023532-转换自-png

人像写真:hyper-realistic Scandinavian woman portrait, flowing platinum blonde hair and piercing blue eyes with prominent freckles, sharp intellectual gaze, Nordic cold-toned directional lighting creating icy atmosphere, minimalist modern styling with clean lines, shallow depth-of-field blurred cold-gradient background, authentic Nordic facial features and porcelain skin texture.写实摄影:fish-eye perspective forest scene with dramatic perspective distortion, ultra-detailed red fox staring into lens with piercing amber eyes, hyper-realistic fur texture showing individual guard hairs and undercoat layers, radially warped trees forming circular background patterns, watercolor painting style with translucent washes and organic pigment bleeding, soft pastel palette of moss green and earth ochre tones, painterly lighting with atmospheric glow through canopy gaps绘画流派:Vintage oil painting style pastoral song, a farmer herding sheep across a meadow full of wildflowers, a windmill in the distance turning under blue sky and white clouds, smoke curling from the chimney of a wooden house, bright and soft colors, full of tranquility and comfort.​文字生成:植物图鉴的一页,手绘水彩风格,描绘了一株“蒲公英”,并标注了它的各个部位名称。海报设计:Cinematic poster scene: Extreme macro close-up of eye in wooden crack. Minimalist monochrome, watercolor-CGI fusion, low saturation. Slow push-in with tremor for surreal intensity. Vast negative space, hidden title. Optimized for immersive video generation.组图生成:一位老人的一生回忆,四张不同画框的肖像画,分别描绘他的童年(黑白照片)、青年(军装照)、中年(西装工作照)和晚年(与老伴的合影)。

模型选型

  • qwen-image-3.0-pro:千问图像3.0旗舰版,支持prompt智能改写,擅长文本渲染,能精准生成贴合物理材质的中英文。
  • wan2.7-image-pro:功能最全面,支持组图生成和高达4096x4096的分辨率,并增强了五官控制、色彩控制和超长文字渲染能力。
  • z-image-turbo:追求速度与性价比。生成速度快、成本低,擅长高逼真度的人像与产品图。

使用方式

文生图提供两种使用方式,请按需选择:

使用方式

是否需要编程

入口

适用场景

网页版在线体验

模型体验中心(见本文开篇的在线体验链接)

快速试用模型、验证提示词效果、少量出图

API 调用

见下方快速开始

在自有应用或服务中批量、自动化地集成文生图能力

快速开始

前提条件

在调用前,请获取与配置 API Key,再配置API Key到环境变量。如果通过DashScope SDK进行调用,还需要安装SDK

示例代码

调用方式说明
  • 千问-同步调用
  • 万相-异步调用
  • Python
  • Java
  • curl
import os
import base64
import mimetypes
import dashscope
from dashscope import MultiModalConversation

dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'

response = MultiModalConversation.call(
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    model="qwen-image-3.0-pro",
    messages=[{
        "role": "user",
        "content": [
            {"text": "画面是一张竖幅户外人像摄影,整体从上到下呈现温暖的午后街景氛围。顶部左侧到上方大面积被深绿色藤蔓和橙色小花覆盖,花叶从建筑檐口自然垂落,受阳光照射的叶片呈黄绿色高光,阴影处则偏深绿,形成浓密而柔和的背景层次。左上至中上区域是一块深蓝色横向招牌,招牌表面较暗、略带磨砂质感,上面以白色哥特体大字写着 Il Messaggero,文字位于画面左侧偏上,部分被前景花叶轻微遮挡,字体高对比、带装饰性尖角和粗细变化。招牌下方是报刊亭或书报摊的玻璃展示窗,黑色金属框架将橱窗分隔成多个矩形区域,内部陈列着许多报纸、杂志和书刊封面,但大多因景深虚化和光线反射而难以辨读,形成浅色纸张与深色边框交错的背景纹理。画面右上方是强烈的逆光区域,阳光从街道尽头照入,背景建筑被虚化成米灰色块面,边缘柔和,呈现明显的浅景深效果。画面中部偏右是一名年轻成年女性的半身至膝上人像,她回头面向镜头微笑,身体略向右转,肩背朝向观者,姿态自然放松。她有长而浓密的黑色波浪卷发,发丝被逆光勾勒出金色轮廓光,发梢在右侧向外散开,显得轻盈蓬松。她肤色白皙,脸型柔和偏鹅蛋形,眉形细致,眼睛明亮,眼妆清透,睫毛明显,面部带有自然高光,唇部为柔和珊瑚红色,笑容露齿,表情亲切明朗。她佩戴小巧耳饰,身穿黑色细肩带露背连衣裙,面料颜色深黑、轮廓简洁,细肩带从肩部向背部延伸,背部线条清晰。画面下部偏左到中部,她双手抱着一束玫瑰花,花束体积较大,主要由橙色、杏色、粉色和浅桃色玫瑰组成,花瓣层层卷曲,边缘被阳光照亮,绿色叶片和长花茎从花束下方垂出,花束与黑色裙装形成鲜明色彩对比。右侧背景是一条被阳光照亮的城市街道,地面呈暖灰与金黄色调,远处建筑、街边设施和一个模糊的红色圆形交通标志位于右下远景,均因焦外虚化而只保留色块和轮廓。整张照片采用暖色胶片感处理,带有细腻颗粒、柔和对比和明显逆光边缘光,人物位于视觉焦点,背景报刊亭、花藤、街道和阳光共同营造出浪漫、明亮、都市漫步式的氛围。"}
        ]
    }],
    prompt_extend=True
)

print(response)
if response.status_code == 200:
    url = response.output.choices[0].message.content[0]["image"]
    print(f"Generated image URL: {url}")
else:
    print(f"Error: {response.code} - {response.message}")

关键能力

1. 指令遵循(提示词)

参数:messages.content.textinput.prompt(必选)、negative_prompt(可选)。
  • text \ prompt(正向提示词):描述希望在画面中看到的内容、主体、场景、风格、光照和构图。文生图的核心控制参数。
  • negative_prompt(反向提示词):描述不希望在画面中出现的内容,如“模糊”、“多余的手指”等。仅用于辅助优化生成质量。
  • 文本渲染(画面中的文字):模型可在画面中生成中英文文字,但对长文本(如完整古诗、长段落或多行文字)难以逐字精准还原,易出现错字、漏字或形近字替代。如对画面内文字的准确性有要求,建议尽量缩短画面内文字、仅保留关键标题或短语,或对成图中的关键文字进行后期编辑。
撰写技巧:一个结构化的 Prompt 通常能带来更好的效果,撰写技巧请参见文生图Prompt指南
wan2.7-image-pro、wan2.7-image不支持negative_prompt参数,对于不希望出现的元素,请在正向提示词中描述(不要出现xxx)。

2. 开启prompt智能改写

参数: parameters.prompt_extend (bool, 默认为 true)。 此功能可自动扩展和优化较短的Prompt,提升出图效果。开启此功能额外耗时 3-5 秒。此耗时为使用大模型改写文本。 实践建议:
  • 建议开启:当输入 Prompt 较简洁或宽泛时,此功能可显著提升图像效果。
  • 建议关闭:若需控制画面细节、或已提供详细描述,或对响应延迟敏感。请将参数 prompt_extend 显式设为false
wan2.7-image-pro、wan2.7-image不支持prompt_extend参数,可通过开启thinking_mode提升出图质量。
参数: parameters.prompt_extend_mode (string,可选,默认为 direct)。仅qwen-image-3.0系列支持,用于指定prompt_extend开启后的改写方式:
  • direct:直接提示词增强(DPE),适用于大多数场景。文生图(T2I)和图生图/图像编辑(I2I)均支持。
  • agent:智能体提示词增强(APE),提供更精细的改写效果,仅支持文生图(T2I)。图生图/图像编辑(I2I)场景传入agent将返回400错误。

3. 设置输出图像分辨率

参数: parameters.size (string),格式为 "宽*高"

模型

size格式

总像素支持范围

默认

宽高比

wan2.7-image-pro

缩写

1K(1024*1024)、2K(2048*2048)、4K(4096*4096)

2K(2048*2048)

1:8 – 8:1

自定义 "宽*高"

768*768 – 4096*4096

wan2.7-image

缩写

1K(1024*1024)、2K(2048*2048)

2K(2048*2048)

1:8 – 8:1

自定义 "宽*高"

768*768 – 2048*2048

wan2.6-image(图文混排输出模式)

自定义 "宽*高"

768*768 – 1280*1280

匹配输入宽高比 (≤1280*1280)

1:4 – 4:1

wan2.6-t2i, wan2.5-t2i-preview

自定义 "宽*高"

1280*1280 – 1440*1440

1280*1280

1:4 – 4:1

wan2.2 及更早的 t2i 模型

自定义 "宽*高"

[512, 1440],且总像素 ≤1440*1440

1024*1024

-

qwen-image-3.0 系列

自定义 "宽*高"

512*512 – 2048*2048

模型自动推荐

1:8 – 8:1

qwen-image-2.0 系列

自定义 "宽*高"

512*512 – 2048*2048

2048*2048

-

qwen-image-max / qwen-image-plus 系列

仅限固定预设尺寸

见下方预设尺寸

1664*928 (16:9)

-

wan2.7-image-pro仅文生图场景(无图片输入、非组图生成)支持4K与自定义40964096分辨率,其余场景仅支持2K与20482048分辨率。
qwen-image-max、qwen-image-plus 系列:仅支持以下 5 种固定的分辨率:
  • 1664*928(默认值):16:9
  • 1472*1104:4:3
  • 1328*1328:1:1
  • 1104*1472:3:4
  • 928*1664:9:16
推荐分辨率:

宽高比

4K (wan2.7-image-pro)

2K (wan2.7-image, qwen-image-3.0系列, qwen-image-2.0系列)

1K (Wan t2i)

1:1

4096*4096

2048*2048

1280*1280

16:9

4096*2304

2688*1536

1696*960

9:16

2304*4096

1536*2688

960*1696

4:3

4096*3072

2368*1728

1472*1104

3:4

3072*4096

1728*2368

1104*1472

4. 组图生成

参数:parameters.enable_sequential(bool,默认为 false)。仅wan2.7-image-prowan2.7-image支持。 设为true时启用组图模式,模型将根据提示词和参考图片的内容一次性生成多张有故事连贯性的图像。
  • 生成数量:通过n参数控制,开启组图模式时,取值范围1~12(默认12),实际数量由模型决定且不超过n。
  • 注意:开启组图模式时,thinking_modecolor_palette参数不可用。

5. 思考模式

参数:parameters.thinking_mode(bool,默认为 true)。仅wan2.7-image-prowan2.7-image支持。 开启时,模型将增强推理能力以提升出图质量,但会增加生成耗时。
仅在关闭组图模式(enable_sequential=false)时可用。

6. 自定义颜色主题

参数:parameters.color_palette(array)。仅wan2.7-image-prowan2.7-image支持。 通过传入包含颜色(hex)和占比(ratio)的对象数组,自定义生成图像的颜色方案。需包含3至10种颜色,推荐设置为8种。所有ratio值相加总和必须为100.00%。
仅在关闭组图模式(enable_sequential=false)时可用。
"color_palette": [
    {
        "hex": "#C2D1E6",
        "ratio": "23.51%"
    },
    {
        "hex": "#CDD8E9",
        "ratio": "20.13%"
    },
    {
        "hex": "#B5C8DB",
        "ratio": "15.88%"
    },
    {
        "hex": "#C0B5B4",
        "ratio": "13.27%"
    },
    {
        "hex": "#DAE0EC",
        "ratio": "10.11%"
    },
    {
        "hex": "#636574",
        "ratio": "8.93%"
    },
    {
        "hex": "#CACAD2",
        "ratio": "5.55%"
    },
    {
        "hex": "#CBD4E4",
        "ratio": "2.62%"
    }
]

7. 其他通用参数

参数:parameters.n(integer,可选,默认为 1)。输出图像的数量。qwen-image-3.0 系列支持 1~6 张;wan2.7-image-prowan2.7-image 在关闭组图模式时支持 1~4 张;开启组图模式时表示最大生成图像数量(取值范围 1~12,默认为 12),详见上文“组图生成”。
n 直接影响费用:费用 = 单价 × 成功生成的图片张数。
参数:parameters.seed(integer,可选,取值范围 [0, 2147483647])。随机数种子,未传入时由服务随机选择;使用相同 seed 可使生成结果保持相对稳定。具体支持情况以各模型的 API 参考为准。 参数:parameters.watermark(bool,可选,默认为 false)。是否添加水印标识,水印位于图片右下角,文案为“AI生成”。

应用于生产环境

  • 容错策略
    • 处理限流:当 API 返回 Throttling 错误码或 HTTP 429 状态码时,表明已触发限流,限流处理请参见限流
    • 异步任务轮询:轮询查询异步任务结果时,建议采用合理的轮询策略(如前30秒每3秒一次,之后拉长间隔),避免因过于频繁的请求而触发限流。为任务设置一个最终超时时间(如 2 分钟),超时后标记为失败。
  • 风险防范
    • 结果持久化:API 返回的图片 URL 有 24 小时有效期。生产系统必须在获取 URL 后立即下载图片,并转存至您自己的持久化存储服务中(如阿里云对象存储 OSS)。
    • 内容安全审核:所有 promptnegative_prompt 都会经过内容安全审核。若输入内容不合规,请求将被拦截并返回 DataInspectionFailed 错误。
    • 生成内容的版权与合规风险:请确保您的提示词内容符合相关法律法规。生成包含品牌商标、名人肖像、受版权保护的 IP 形象等内容可能涉及侵权风险,请您自行评估并承担相应责任。

API文档

错误码

如果模型调用失败并返回报错信息,请参见错误码进行解决。

常见问题

Q: 图片 URL 多久会失效?我应该如何永久保存图片? A: 图片 URL 的有效期为 24 小时。您必须在获取到 URL 后,立即通过程序下载图片,并将其保存到您自己的持久化存储中,例如本地服务器或阿里云对象存储 OSS。 Q: 调用API返回DataInspectionFailed错误,如何处理? A: 该错误表示输入文本触发了内容安全审核。请检查并修改prompt或negative_prompt中的文本,移除可能违规的内容后重试。 Q: prompt_extend参数应该开启还是关闭? A: 当输入的prompt比较简洁或希望模型发挥更多创意时,建议保持开启(默认)。当prompt已经非常详细、专业,或对API响应延迟有严格要求时,建议显式设置为false。 注意:wan2.7-image-pro、wan2.7-image不支持prompt_extend参数,可通过开启thinking_mode提升出图质量。 Q:模型体验如何清空会话的内容? A: 点击控制台右上角清空当前对话
Token Plan
模型体验
用量统计与性能监控
资产中心
服务支持