必须用三段式提示词结构:主体描述+遮罩强化词+新背景描述;遮罩强化词必含“person in foreground, clear silhouette, well-defined edges”;纯色背景需加Solid Color Background节点,自然场景需匹配光影,室内场景须含环境光线索;负向提示词须包含“cloned background, repeated pattern, tiled texture”。
☞☞☞AI 智能聊天, 问答助手, AI 智能搜索, 多模态理解力帮你轻松跨越从0到1的创作门槛☜☜☜

要在ComfyUI中实现人物换背景,必须让提示词精准配合ControlNet或Segment Anything等节点的语义理解逻辑,不能照搬SD WebUI的写法——直接写“white background”可能被模型忽略,而漏写主体描述会导致抠图失败。
基础提示词结构:主体+遮罩+背景三段式
第一步:在Positive提示词框中,按顺序写【主体描述】+【遮罩强化词】+【新背景描述】,三者用英文逗号分隔,不换行。
主体描述要具体到服装、姿态、肤色细节,例如:“a young East Asian woman, wearing light blue sweater, smiling, front view, high-resolution face details”。
遮罩强化词必须包含“【person in foreground, clear silhouette, well-defined edges】”,这是触发Segment Anything或CLIPSeg准确分割的关键短语,缺了会导致背景残留或主体断裂。
新背景描述放在最后,用具体场景替代抽象词,比如写“sunset beach with palm trees and gentle waves”,而不是“beautiful background”。
针对不同背景类型的提示词变体
方法一:纯色背景(用于电商图)→ 直接写“solid color background, studio lighting, seamless gradient”,并在KSampler前插入“Solid Color Background”节点,用RGB值精确控制颜色。
方法二:自然场景融合 → 在背景描述后追加“photorealistic lighting matching subject, consistent shadow direction, depth of field blur on background”,否则人物像贴纸一样浮在背景上。
方法三:室内场景 → 必须加入环境光线索,如“indoor living room with warm ambient light, soft shadows from window on left, bookshelf in background”,否则模型会生成无光源逻辑的违和空间。
负向提示词必须屏蔽的干扰项
写入Negative prompt:“deformed hands, bad anatomy, extra limbs, text, watermark, logo, blurry background, lowres, jpeg artifacts, out of frame, disfigured, mutated, ugly, duplicate, morbid, mutilated, poorly drawn face, deformed, extra fingers, mutated hands, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck”。
特别注意:一定要加上“【cloned background, repeated pattern, tiled texture】”,否则使用Tile Diffusion节点时容易出现背景平铺伪影。

















