ComfyUI workflow with Regional Prompt for couple focus V2 with two method

详情

模型描述

XL 模型的区域提示工作流

这是我在过去或最近使用的一些工作流的组合。

区域提示的大部分内容最初来自这个 工作流

衷心感谢 @zml_w 的所有测试和帮助。

@LevPat 提供的 V2 放大方法:
/model/1994653/custom-upscale-flow

用户指南

https://civitai.com/articles/18257

适用于 V2 密集扩散与注意力耦合

我制作了两个使用不同区域提示方法的独立工作流,两者均包含在归档文件中,供您尝试。

密集扩散

关于错误:“张量 a 的大小 (924) 必须与张量 b 的大小 (308) 在非单例维度 3 上匹配”

该错误在密集扩散中依然存在,但如今我已100%明确其原因,因此我会详细说明如何避免它。

您几乎可以在所有正向提示中加入任何内容——左侧角色的提示细节丰富、动作多样,而第二个角色的提示几乎为空,也不会触发此错误。
唯一会导致该错误出现的情况是:正向提示与负向提示之间的对比。

那么为何会出现此错误?几乎完全是因为嵌入(Embeddings)——由于标记(Tokens)数量以及密集扩散的工作方式,标记的大小必须几乎一致。当您使用嵌入(如 Lazyhand、Lazyneg 等)时,会消耗大量标记(更准确地说是标记块)。

如何避免?您可以完全不使用嵌入,我在工作流中已添加注释,提供我认为质量良好的提示。

您仍可使用嵌入,但必须在正负提示之间进行平衡。例如,如果您在负向提示中使用了 Lazyhand + Lazyneg,那么您必须在正向提示中至少使用一个或多个嵌入,以使标记块大小一致。

因此,我创建了一个由我自己(和 GPT)开发的自定义节点,用于标准化负向提示,您可以选择开启或关闭,归档中已附上对比图。

如果您不喜欢或不认同此方法,我还制作了另一种使用“注意力耦合”节点的工作流。

注意力耦合

使用注意力耦合时,此错误永远不会出现,那为何不直接用它并放弃密集扩散?
注意力耦合效果不错,能产生相当好的结果,但在我的测试中发现它有两个主要缺陷:

第一,LoRA 在此方法下的应用方式不同,密集扩散似乎能更好地融合模型与 LoRA。
第二,交互也更困难。虽然我没有广泛使用它,但我生成的几张图像似乎提示遵循度较低。

以下是两种方法所需的所有节点

密集扩散所需节点:

https://github.com/Fannovel16/comfyui_controlnet_aux
https://github.com/ltdrdata/ComfyUI-Impact-Pack
https://github.com/rgthree/rgthree-comfy
https://github.com/yolain/ComfyUI-Easy-Use
https://github.com/kijai/ComfyUI-KJNodes
https://github.com/ssitu/ComfyUI_UltimateSDUpscale
https://github.com/cubiq/ComfyUI_essentials
https://github.com/ClownsharkBatwing/RES4LYF
https://github.com/giriss/comfy-image-saver
https://github.com/shiimizu/ComfyUI_smZNodes
https://github.com/ltdrdata/ComfyUI-Impact-Subpack
https://github.com/huchenlei/ComfyUI_densediffusion
https://github.com/edelvarden/comfyui_image_metadata_extension
https://github.com/rcsaquino/comfyui-custom-nodes
https://github.com/zml-w/ComfyUI-ZML-Image
(https://github.com/zml-w/ZZZ_ZML_English_Patch)

归档中包含一个用于负向标准化的小型自定义节点,只需将其放入自定义节点文件夹即可,无需额外依赖。

注意力耦合所需节点:

以上所有节点 +
https://github.com/BlenderNeko/ComfyUI_ADV_CLIP_emb
https://github.com/laksjdjf/cgem156-ComfyUI

如果您在导入 cgem156 时遇到 FAILED IMPORT 错误,可尝试此修复方法:
https://github.com/laksjdjf/cgem156-ComfyUI/issues/17#issuecomment-2918745574
我在 ComfyUI 桌面版上测试有效。

旧版工作流

我添加了一个链式采样器,因为我非常喜爱这种方法的渲染时间与最终效果。

这是一个相当高级的工作流,需要大量自定义节点,部分节点可能与 ComfyUI 管理器不兼容,我在此列出链接,供您手动安装。

请确保您已激活 venv 环境以满足自定义节点的 requirements.txt 依赖。

归档中还包含一个简化版本,如果您希望在不使用 HiresFix、人脸细节增强、放大和颜色匹配等所有节点的情况下尝试,可以使用它。

请注意:您自行安装节点可能导致 ComfyUI 安装损坏,某些节点可能使用与您已安装的 PyTorch 版本或其他依赖项冲突的版本,本人不承担任何责任。

https://github.com/ltdrdata/ComfyUI-Impact-Pack

https://github.com/pythongosssss/ComfyUI-Custom-Scripts

https://github.com/rgthree/rgthree-comfy

https://github.com/yolain/ComfyUI-Easy-Use

https://github.com/shadowcz007/comfyui-mixlab-nodes

https://github.com/jags111/efficiency-nodes-comfyui

https://github.com/ssitu/ComfyUI_UltimateSDUpscale

https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes

https://github.com/cubiq/ComfyUI_essentials

https://github.com/ClownsharkBatwing/RES4LYF

https://github.com/ltdrdata/ComfyUI-Impact-Subpack

https://github.com/huchenlei/ComfyUI_densediffusion

https://github.com/edelvarden/comfyui_image_metadata_extension

https://github.com/Miosp/ComfyUI-FBCNN

https://github.com/rcsaquino/comfyui-custom-nodes

https://github.com/weilin9999/WeiLin-ComfyUI-prompt-all-in-one

请改用此版本替代旧版,我已用新版修复了工作流:

https://github.com/weilin9999/WeiLin-Comfyui-Tools

V1 多遮罩版本

https://github.com/chflame163/ComfyUI_LayerStyle

https://github.com/kijai/ComfyUI-KJNodes

https://github.com/chrisgoringe/cg-use-everywhere

https://github.com/giriss/comfy-image-saver

此模型生成的图像

未找到图像。