diff --git a/README-CN.md b/README-CN.md index e864612..8fa9d6f 100644 --- a/README-CN.md +++ b/README-CN.md @@ -3,23 +3,25 @@ StoryDiffusion方法的地址: [StoryDiffusion](https://github.com/HVision-NKU/StoryDiffusion) 以及 MS-Diffusion的地址: [link](https://github.com/MS-Diffusion/MS-Diffusion) ## 更新: -**2024/09/05** -*使用SDXL单体模型时,可能会报错,是因为runway 删除了他们的模型库,解决版本是升级到最新版的diffusers或者修改diffuser的代码内容,修改方法见链接:[link](https://github.com/huggingface/diffusers/commit/d8a16635f47ac455abd61879bcc6be32dfeaa561) +**2024/09/15** +* 中秋节快乐!! +* 加入flux pulid 支持,目前fp8,和fp16能正常出图,但是fp16需要30G以上显存,可以忽略,需要有flux的diffuser文件(在repo输入),以及对应的模型,然后easy function 填入pilid,fp8,cpu就可以开启,如果你的显存大于16G可以试试取消cpu,这样会快一点。nf4也能跑通,但是量化的思路不同,无法正常出图 +* 加入kolor face id的支持,开启条件,在easyfunction里输入face,然后repo输入你的kolor diffuser模型的绝对路径地址。 **既往更新** +* 加入diffuser尚未PR的图生图代码,fp8和fn4都能跑,还是nf4吧,快很多。图生图的噪声控制,由ip_adapter_strength的参数控制,越大噪声越多,当然图片不像原图,反之亦然。然后生成的实际步数是 你输入的步数*ip_adapter_strength的参数,也就是说,你输入50步,strength是0.8,实际只会跑40步。 +* 双角色因为方法的原因无法使用非正方形图片,所以用了讨巧的方法,先裁切成方形,然后再裁切回来; +* 高宽的全局变量名会导致一些啼笑皆非的错误,所以改成特别点的; +* 现在如果只使用flux的repo模型,不再自动保存一个pt文件,除非你在easy function输入save; +* 使用SDXL单体模型时,可能会报错,是因为runway 删除了他们的模型库,所以加入了内置的config文件,避免加载出错,这样的另一个好处,就是首次使用时,不用连外网了。 * 加载nf4模型的速度比fp8快了许多倍,所以我推荐使用nf4模型来运行flux。我已经把nf4的工作流放入example,只需下载单体模型地址,[link](https://huggingface.co/sayakpaul/flux.1-dev-nf4/tree/main) ,当然flux的完整diffuser模型也是必须的。 * 加入easy function,便于调试新的功能,此次加入的是photomake V2对auraface的支持,你可以在easy function 输入auraface以测试该方法 - -* 修复bug,修改MS的一些代码,去掉flux模型加载节点, * 如果单独运行flux的repo,会自动保存pt模型(fp8)的,你可以运行至模型保存后就中断,然后用repo+pt模型,或者repo+其他fp8模型,或者repo+重新命名的pt模型(不带transformer字眼即可)来使用flux,速度更快。单独加载repo很耗时。 -* 特别更新:现在双角色同框的加载方式改成[A]...[B]...模式,原来的(A and B)模式已经摈弃!!!! -* 加入实验版的FLUX diffusers pippline流程,repo填写black-forest-labs/FLUX.1-dev或者X:/XXX/black-forest-labs/FLUX.1-dev 开启,需要高版本的diffusers和optimum-quanto,请谨慎测试. +* 特别更新:现在双角色同框的加载方式改成[A]...[B]...模式,原来的(A and B)模式已经摈弃摒弃!!!! * 特别注意,因为可灵模型比较大,所以采用了CPU加载,所以首次加载需要很大的内存才行。 * 加入可灵kolor模型的支持,支持文生图和可灵ipadapter的图生图,需要的模型文件见下方; * 加入photomakerV2的支持,由于V2版需要insight face ,所以不会装的谨慎尝试; -* 模型现在只有使用repo输入或者选择社区模型两种方式,修复了一些bug; * controlnet现在使用单体模型; -* 调整MS的模型加载,速度更快了; * 修复引入模块的错误,现在模型存放地址改至models/photomaker,重复利用模型,避免浪费硬盘空间(存储的pt模型也会在photomaker下); * 新增controlnet布局控制按钮,默认是否,为程序自动。 * 为双角色同图引入controlnet,并支持多图引入(MS还是保留吧,剔除了有些人又不想装2个插件。 ) @@ -33,7 +35,7 @@ StoryDiffusion方法的地址: [StoryDiffusion](https://github.com/HVision-NKU/S git clone https://github.com/smthemex/ComfyUI_StoryDiffusion.git ``` -或者用manage 安装。。 +或者用manager 安装。。 2.需求文件 ---- @@ -55,7 +57,7 @@ repo模式 支持所有基于SDXL的扩散模型(如G161222/RealVisXL_V4.0,s 单体模型支持SDXL,例如:Juggernaut-XL_v9_RunDiffusionPhoto_v2.safetensors ), --(使用双角色功能时): -你用全局外网,会自动下载,但是一般是去C盘。 +你用全局外网,会自动下载。 在comfyUI/models/photomaker目录下,确认是否有photomaker-v1.bin,如果没有会自己下载 [离线下载地址](https://huggingface.co/TencentARC/PhotoMaker/tree/main) photomaker-v2.bin 虽然也能用,但是新代码没有更新,所以发挥不了其新特性 [离线下载地址](https://huggingface.co/TencentARC/PhotoMaker-V2/tree/main) @@ -74,6 +76,8 @@ photomaker-v2.bin 虽然也能用,但是新代码没有更新,所以发挥 如果要使用kolor(可灵),下载链接如下: Kwai-Kolors [link](https://huggingface.co/Kwai-Kolors/Kolors/tree/main) Kolors-IP-Adapter-Plus [link](https://huggingface.co/Kwai-Kolors/Kolors-IP-Adapter-Plus/tree/main) +Kolors-IP-Adapter-FaceID-Plus [link](https://huggingface.co/Kwai-Kolors/Kolors-IP-Adapter-FaceID-Plus) + 文件结构如下,注意是有层级的: ``` ├── 你的本地任意地址/Kwai-Kolors/Kolors @@ -113,6 +117,22 @@ Kolors-IP-Adapter-Plus [link](https://huggingface.co/Kwai-Kolors/Kolors-IP-Adap | ├──tokenizer.json | ├──tokenizer_config.json | ├──vocab.json +| ├── clip-vit-large-patch14-336 # if using Kolors-IP-Adapter-FaceID-Plus +| ├──config.json +| ├──merges.txt +| ├──preprocessor_config.json +| ├──pytorch_model.bin +| ├──special_tokens_map.json +| ├──tokenizer.json +| ├──tokenizer_config.json +| ├──vocab.json +``` +如果使用kolor的face ip还需要: +自动下载的insightface模型 "DIAMONIK7777/antelopev2" insightface models.... +ipa-faceid-plus.bin 模型下载地址,放在如下目录 [link](https://huggingface.co/Kwai-Kolors/Kolors-IP-Adapter-FaceID-Plus) +``` +├── ComfyUI/models/photomaker/ +| ├── ipa-faceid-plus.bin ``` 3.2 离线模式 @@ -130,8 +150,59 @@ Kolors-IP-Adapter-Plus [link](https://huggingface.co/Kwai-Kolors/Kolors-IP-Adap | ├──xinsir/controlnet-tile-sdxl-1.0 ``` + control_img图片的预处理,请使用其他节点 +3.4 如果要使用 flux pulid . +确保torch must > 0.24.0,并确保optimum-quanto为0.2.4以上版本 +``` +pip install optimum-quanto==0.2.4 +``` +EVA02_CLIP_L_336_psz14_s6B.pt 会自动下载....[link](https://huggingface.co/QuanSun/EVA-CLIP/tree/main) #迟点改成不自动下载 +DIAMONIK7777/antelopev2 会自动下载,kolor也用这个....[https://huggingface.co/DIAMONIK7777/antelopev2/tree/main) +"pulid_flux_v0.9.0.safetensors" 下载至 [link](https://huggingface.co/guozinan/PuLID/tree/main) +fp8 using flux1-dev-fp8.safetensors 这个unt很多人应该有,放在checkpoints目录 [link](https://huggingface.co/Kijai/flux-fp8/tree/main) +``` +├── ComfyUI/models/photomaker/ +| ├── pulid_flux_v0.9.0.safetensors +``` +确保 ae.safetensors 在你的 FLUX.1-dev 目录下,以下是文件夹示例: +``` +├──any_path/black-forest-labs/FLUX.1-dev +| ├──model_index.json +| ├──ae.safetensors +| ├──vae +| ├── config.json +| ├── diffusion_pytorch_model.safetensors +| ├──transformer +| ├── config.json +| ├──diffusion_pytorch_model-00001-of-00003.safetensors +| ├──diffusion_pytorch_model-00002-of-00003.safetensors +| ├──diffusion_pytorch_model-00003-of-00003.safetensors +| ├── diffusion_pytorch_model.safetensors.index.json +| ├──tokenizer +| ├── special_tokens_map.json +| ├── tokenizer_config.json +| ├── vocab.json +| ├── merges.txt +| ├──tokenizer_2 +| ├── special_tokens_map.json +| ├── tokenizer_config.json +| ├── spiece.model +| ├── tokenizer.json +| ├── text_encoder +| ├── config.json +| ├── model.safetensors +| ├── text_encoder_2 +| ├── config.json +| ├── model-00001-of-00002.safetensors +| ├── model-00002-of-00002.safetensors +| ├── model.safetensors.index.json +| ├── scheduler +| ├── scheduler_config.json +``` + + 4 Example ---- 请看英文版的提示 @@ -198,30 +269,6 @@ control_img图片的预处理,请使用其他节点 * 如果需要图片不出现角色,场景prompt前面加入[NC] ; * 分段prompt,用#,例如 AAAA#BBBB,将生成AAAA内容,但是文字只显示BBBB - -我的其他comfyUI插件: ------ -1、ParlerTTS: (ParlerTTS英文的音频节点):[ComfyUI_ParlerTTS](https://github.com/smthemex/ComfyUI_ParlerTTS) -2、Llama3_8B: 羊驼3的节点,也兼容了其他基于羊驼3的模型):[ComfyUI_Llama3_8B](https://github.com/smthemex/ComfyUI_Llama3_8B) -3、HiDiffusion: (高清放大节点):[ComfyUI_HiDiffusion_Pro](https://github.com/smthemex/ComfyUI_HiDiffusion_Pro) -4、ID_Animator: (零样本单图制作视频): [ComfyUI_ID_Animator](https://github.com/smthemex/ComfyUI_ID_Animator) -5、StoryDiffusion:(故事绘本节点):[ComfyUI_StoryDiffusion](https://github.com/smthemex/ComfyUI_StoryDiffusion) -6、Pops: (材质、融合类节点,基于pops方法):[ComfyUI_Pops](https://github.com/smthemex/ComfyUI_Pops) -7、stable-audio-open-1.0: (SD官方的音频节点的简单实现) :[ComfyUI_StableAudio_Open](https://github.com/smthemex/ComfyUI_StableAudio_Open) -8、GLM4: (基于智普AI的api节点,涵盖智普的本地大模型):[ComfyUI_ChatGLM_API](https://github.com/smthemex/ComfyUI_ChatGLM_API) -9、CustomNet: (基于腾讯的CustomNet做的角度控制节点):[ComfyUI_CustomNet](https://github.com/smthemex/ComfyUI_CustomNet) -10、Pipeline_Tool: (方便玩家调用镜像抱脸下载) :[ComfyUI_Pipeline_Tool](https://github.com/smthemex/ComfyUI_Pipeline_Tool) -11、Pic2Story: (基于模型的图像识别) :[ComfyUI_Pic2Story](https://github.com/smthemex/ComfyUI_Pic2Story) -12、ComfyUI_Streamv2v_Plus: (视频转绘,能用,未打磨):[ComfyUI_Streamv2v_Plus](https://github.com/smthemex/ComfyUI_Streamv2v_Plus) -13、ComfyUI_MS_Diffusion: (基于MS-diffusion做的故事话本):[ComfyUI_MS_Diffusion](https://github.com/smthemex/ComfyUI_MS_Diffusion) -14、ComfyUI_AnyDoor: (一键换衣插件): [ComfyUI_AnyDoor](https://github.com/smthemex/ComfyUI_AnyDoor) -15、ComfyUI_Stable_Makeup: (一键化妆): [ComfyUI_Stable_Makeup](https://github.com/smthemex/ComfyUI_Stable_Makeup) -16、ComfyUI_EchoMimic: (音频驱动动画): [ComfyUI_EchoMimic](https://github.com/smthemex/ComfyUI_EchoMimic) -17、ComfyUI_FollowYourEmoji: (画面驱动表情包): [ComfyUI_FollowYourEmoji](https://github.com/smthemex/ComfyUI_FollowYourEmoji) -18、ComfyUI_Diffree : [超强的一致性的文生图内绘](https://github.com/smthemex/ComfyUI_Diffree) -19、ComfyUI_FoleyCrafter : [给视频配音的节点](https://github.com/smthemex/ComfyUI_FoleyCrafter) -20、ComfyUI_MooERr node: [语音识别加翻译](https://github.com/smthemex/ComfyUI_MooER) - Citation ------ @@ -272,3 +319,16 @@ kolors year={2024} } ``` +``` +PuLID +``` +@article{guo2024pulid, + title={PuLID: Pure and Lightning ID Customization via Contrastive Alignment}, + author={Guo, Zinan and Wu, Yanze and Chen, Zhuowei and Chen, Lang and He, Qian}, + journal={arXiv preprint arXiv:2404.16022}, + year={2024} +} +``` + +FLUX +![LICENSE](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)