diff --git a/templates/index.json b/templates/index.json index 1599786..e41bea2 100644 --- a/templates/index.json +++ b/templates/index.json @@ -68,6 +68,14 @@ "mediaSubtype": "webp", "description": "Generate images with precise object placement using text boxes.", "tutorialUrl": "https://comfyanonymous.github.io/ComfyUI_examples/gligen/" + }, + { + "name": "lora_trainer", + "title": "ComfyUI native LoRA trainer", + "mediaType": "image", + "mediaSubtype": "webp", + "description": "Train LoRA models with ComfyUI native LoRA trainer workflow.", + "tutorialUrl": "http://docs.comfy.org/tutorials/lora-trainer" } ] }, diff --git a/templates/lora_trainer-1.webp b/templates/lora_trainer-1.webp new file mode 100644 index 0000000..1c6a668 Binary files /dev/null and b/templates/lora_trainer-1.webp differ diff --git a/templates/lora_trainer.json b/templates/lora_trainer.json new file mode 100644 index 0000000..18e444a --- /dev/null +++ b/templates/lora_trainer.json @@ -0,0 +1,1258 @@ +{ + "id": "fcbafea4-f115-4d28-af59-2d09680a721c", + "revision": 0, + "last_node_id": 27, + "last_link_id": 34, + "nodes": [ + { + "id": 15, + "type": "KSampler", + "pos": [ + -160, + 190 + ], + "size": [ + 270, + 262 + ], + "flags": {}, + "order": 16, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 19 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 16 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 17 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 20 + }, + { + "name": "seed", + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 25 + }, + { + "name": "steps", + "type": "INT", + "widget": { + "name": "steps" + }, + "link": 22 + }, + { + "name": "cfg", + "type": "FLOAT", + "widget": { + "name": "cfg" + }, + "link": 23 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 31 + ] + } + ], + "properties": { + "Node name for S&R": "KSampler", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 0, + "randomize", + 20, + 0, + "euler", + "normal", + 1 + ] + }, + { + "id": 10, + "type": "KSampler", + "pos": [ + -160, + -180 + ], + "size": [ + 270, + 262 + ], + "flags": {}, + "order": 13, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 18 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 11 + }, + { + "name": "negative", + "type": "CONDITIONING", + "link": 13 + }, + { + "name": "latent_image", + "type": "LATENT", + "link": 14 + }, + { + "name": "seed", + "type": "INT", + "widget": { + "name": "seed" + }, + "link": 26 + }, + { + "name": "steps", + "type": "INT", + "widget": { + "name": "steps" + }, + "link": 21 + }, + { + "name": "cfg", + "type": "FLOAT", + "widget": { + "name": "cfg" + }, + "link": 24 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 27 + ] + } + ], + "properties": { + "Node name for S&R": "KSampler", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 0, + "randomize", + 20, + 8, + "euler", + "normal", + 1 + ] + }, + { + "id": 11, + "type": "CLIPTextEncode", + "pos": [ + -600, + -170 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 10, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 10 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 11, + 16 + ] + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + "" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 19, + "type": "VAEDecode", + "pos": [ + 120, + -180 + ], + "size": [ + 140, + 46 + ], + "flags": { + "collapsed": true + }, + "order": 15, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 27 + }, + { + "name": "vae", + "type": "VAE", + "link": 28 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 29 + ] + } + ], + "properties": { + "Node name for S&R": "VAEDecode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [] + }, + { + "id": 20, + "type": "PreviewImage", + "pos": [ + 120, + -140 + ], + "size": [ + 450, + 220 + ], + "flags": {}, + "order": 19, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 29 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [] + }, + { + "id": 21, + "type": "VAEDecode", + "pos": [ + 130, + 200 + ], + "size": [ + 140, + 46 + ], + "flags": { + "collapsed": true + }, + "order": 20, + "mode": 0, + "inputs": [ + { + "name": "samples", + "type": "LATENT", + "link": 31 + }, + { + "name": "vae", + "type": "VAE", + "link": 32 + } + ], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 30 + ] + } + ], + "properties": { + "Node name for S&R": "VAEDecode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [] + }, + { + "id": 22, + "type": "PreviewImage", + "pos": [ + 130, + 240 + ], + "size": [ + 440, + 200 + ], + "flags": {}, + "order": 21, + "mode": 0, + "inputs": [ + { + "name": "images", + "type": "IMAGE", + "link": 30 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "PreviewImage", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [] + }, + { + "id": 13, + "type": "EmptyLatentImage", + "pos": [ + -940, + -170 + ], + "size": [ + 260, + 110 + ], + "flags": {}, + "order": 0, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 14, + 20 + ] + } + ], + "properties": { + "Node name for S&R": "EmptyLatentImage", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 512, + 512, + 1 + ] + }, + { + "id": 16, + "type": "PrimitiveInt", + "pos": [ + -940, + -10 + ], + "size": [ + 260, + 82 + ], + "flags": {}, + "order": 1, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 21, + 22 + ] + } + ], + "title": "Steps", + "properties": { + "Node name for S&R": "PrimitiveInt", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 20, + "fixed" + ] + }, + { + "id": 18, + "type": "PrimitiveInt", + "pos": [ + -940, + 230 + ], + "size": [ + 260, + 82 + ], + "flags": {}, + "order": 2, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "INT", + "type": "INT", + "links": [ + 25, + 26 + ] + } + ], + "title": "Seed", + "properties": { + "Node name for S&R": "PrimitiveInt", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 0, + "randomize" + ] + }, + { + "id": 17, + "type": "PrimitiveFloat", + "pos": [ + -940, + 120 + ], + "size": [ + 260, + 60 + ], + "flags": {}, + "order": 3, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "FLOAT", + "type": "FLOAT", + "links": [ + 23, + 24 + ] + } + ], + "title": "CFG", + "properties": { + "Node name for S&R": "PrimitiveFloat", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 8 + ] + }, + { + "id": 12, + "type": "CLIPTextEncode", + "pos": [ + -600, + 80 + ], + "size": [ + 400, + 200 + ], + "flags": {}, + "order": 11, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 12 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 13, + 17 + ] + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + "" + ], + "color": "#323", + "bgcolor": "#535" + }, + { + "id": 24, + "type": "LoadImageSetFromFolderNode", + "pos": [ + -960, + -520 + ], + "size": [ + 301.4439392089844, + 82 + ], + "flags": {}, + "order": 4, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "IMAGE", + "type": "IMAGE", + "links": [ + 34 + ] + } + ], + "properties": { + "Node name for S&R": "LoadImageSetFromFolderNode" + }, + "widgets_values": [ + "3d", + "None" + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 25, + "type": "MarkdownNote", + "pos": [ + -1270, + -380 + ], + "size": [ + 280, + 230 + ], + "flags": {}, + "order": 5, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Chinese", + "properties": {}, + "widgets_values": [ + "关于 LoRA 训练的功能的相关建议和反馈欢迎向我们提交 [Issues](https://github.com/comfyanonymous/ComfyUI/issues) 帮助我们改进这个功能支持\n\n### 基础模型\n\n从目前的测试反馈至少支持以下系列模型:\n* SD1.5\n* SDXL\n\n### 图片数据集\n\n你需要把准备好的 **图片集文件夹** 保存到 **ComfyUI/input** 目录下,如果读取不到文件夹请尝试刷新 ComfyUI 界面\n\n" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 6, + "type": "CheckpointLoaderSimple", + "pos": [ + -960, + -670 + ], + "size": [ + 300, + 100 + ], + "flags": {}, + "order": 6, + "mode": 0, + "inputs": [], + "outputs": [ + { + "name": "MODEL", + "type": "MODEL", + "links": [ + 1, + 18 + ] + }, + { + "name": "CLIP", + "type": "CLIP", + "links": [ + 2, + 10, + 12 + ] + }, + { + "name": "VAE", + "type": "VAE", + "links": [ + 5, + 28, + 32 + ] + } + ], + "properties": { + "Node name for S&R": "CheckpointLoaderSimple", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + null + ], + "color": "#322", + "bgcolor": "#533" + }, + { + "id": 8, + "type": "VAEEncode", + "pos": [ + -810, + -390 + ], + "size": [ + 140, + 46 + ], + "flags": { + "collapsed": false + }, + "order": 12, + "mode": 0, + "inputs": [ + { + "name": "pixels", + "type": "IMAGE", + "link": 34 + }, + { + "name": "vae", + "type": "VAE", + "link": 5 + } + ], + "outputs": [ + { + "name": "LATENT", + "type": "LATENT", + "links": [ + 6 + ] + } + ], + "properties": { + "Node name for S&R": "VAEEncode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [] + }, + { + "id": 7, + "type": "CLIPTextEncode", + "pos": [ + -620, + -670 + ], + "size": [ + 410, + 230 + ], + "flags": {}, + "order": 9, + "mode": 0, + "inputs": [ + { + "name": "clip", + "type": "CLIP", + "link": 2 + } + ], + "outputs": [ + { + "name": "CONDITIONING", + "type": "CONDITIONING", + "links": [ + 3 + ] + } + ], + "properties": { + "Node name for S&R": "CLIPTextEncode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + "" + ], + "color": "#232", + "bgcolor": "#353" + }, + { + "id": 3, + "type": "TrainLoraNode", + "pos": [ + -180, + -670 + ], + "size": [ + 270, + 358 + ], + "flags": {}, + "order": 14, + "mode": 0, + "inputs": [ + { + "name": "model", + "type": "MODEL", + "link": 1 + }, + { + "name": "latents", + "type": "LATENT", + "link": 6 + }, + { + "name": "positive", + "type": "CONDITIONING", + "link": 3 + } + ], + "outputs": [ + { + "name": "model_with_lora", + "type": "MODEL", + "links": [ + 19 + ] + }, + { + "name": "lora", + "type": "LORA_MODEL", + "links": [ + 7 + ] + }, + { + "name": "loss", + "type": "LOSS_MAP", + "links": [ + 15 + ] + }, + { + "name": "steps", + "type": "INT", + "links": [ + 8 + ] + } + ], + "properties": { + "Node name for S&R": "TrainLoraNode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + 1, + 16, + 0.0005, + 8, + "AdamW", + "MSE", + 0, + "randomize", + "bf16", + "bf16", + "[None]" + ] + }, + { + "id": 27, + "type": "MarkdownNote", + "pos": [ + 100, + -810 + ], + "size": [ + 270, + 90 + ], + "flags": {}, + "order": 7, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "Note", + "properties": {}, + "widgets_values": [ + "The LoRA files with save at **ComfyUI/output** \n\nLoRA 文件将会保存到 **ComfyUI/output** 文件夹" + ], + "color": "#432", + "bgcolor": "#653" + }, + { + "id": 9, + "type": "SaveLoRANode", + "pos": [ + 120, + -670 + ], + "size": [ + 270, + 78 + ], + "flags": {}, + "order": 18, + "mode": 0, + "inputs": [ + { + "name": "lora", + "type": "LORA_MODEL", + "link": 7 + }, + { + "name": "steps", + "shape": 7, + "type": "INT", + "link": 8 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "SaveLoRANode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + "loras/ComfyUI_trained_lora" + ] + }, + { + "id": 14, + "type": "LossGraphNode", + "pos": [ + 120, + -550 + ], + "size": [ + 480, + 230 + ], + "flags": {}, + "order": 17, + "mode": 0, + "inputs": [ + { + "name": "loss", + "type": "LOSS_MAP", + "link": 15 + } + ], + "outputs": [], + "properties": { + "Node name for S&R": "LossGraphNode", + "cnr_id": "comfy-core", + "ver": "0.3.41" + }, + "widgets_values": [ + "loss_graph" + ] + }, + { + "id": 26, + "type": "MarkdownNote", + "pos": [ + -1270, + -670 + ], + "size": [ + 280, + 230 + ], + "flags": {}, + "order": 8, + "mode": 0, + "inputs": [], + "outputs": [], + "title": "English", + "properties": {}, + "widgets_values": [ + "关于 LoRA 训练的功能的相关建议和反馈欢迎向我们提交 [Issues](https://github.com/comfyanonymous/ComfyUI/issues) 帮助我们改进这个功能支持\n\n### 基础模型\n\n从目前的测试反馈至少支持以下系列模型:\n* SD1.5\n* SDXL\n\n### 图片数据集\n\n你需要把准备好的 **图片集文件夹** 保存到 **ComfyUI/input** 目录下,如果读取不到文件夹请尝试刷新 ComfyUI 界面\n\n" + ], + "color": "#432", + "bgcolor": "#653" + } + ], + "links": [ + [ + 1, + 6, + 0, + 3, + 0, + "MODEL" + ], + [ + 2, + 6, + 1, + 7, + 0, + "CLIP" + ], + [ + 3, + 7, + 0, + 3, + 2, + "CONDITIONING" + ], + [ + 5, + 6, + 2, + 8, + 1, + "VAE" + ], + [ + 6, + 8, + 0, + 3, + 1, + "LATENT" + ], + [ + 7, + 3, + 1, + 9, + 0, + "LORA_MODEL" + ], + [ + 8, + 3, + 3, + 9, + 1, + "INT" + ], + [ + 10, + 6, + 1, + 11, + 0, + "CLIP" + ], + [ + 11, + 11, + 0, + 10, + 1, + "CONDITIONING" + ], + [ + 12, + 6, + 1, + 12, + 0, + "CLIP" + ], + [ + 13, + 12, + 0, + 10, + 2, + "CONDITIONING" + ], + [ + 14, + 13, + 0, + 10, + 3, + "LATENT" + ], + [ + 15, + 3, + 2, + 14, + 0, + "LOSS_MAP" + ], + [ + 16, + 11, + 0, + 15, + 1, + "CONDITIONING" + ], + [ + 17, + 12, + 0, + 15, + 2, + "CONDITIONING" + ], + [ + 18, + 6, + 0, + 10, + 0, + "MODEL" + ], + [ + 19, + 3, + 0, + 15, + 0, + "MODEL" + ], + [ + 20, + 13, + 0, + 15, + 3, + "LATENT" + ], + [ + 21, + 16, + 0, + 10, + 5, + "INT" + ], + [ + 22, + 16, + 0, + 15, + 5, + "INT" + ], + [ + 23, + 17, + 0, + 15, + 6, + "FLOAT" + ], + [ + 24, + 17, + 0, + 10, + 6, + "FLOAT" + ], + [ + 25, + 18, + 0, + 15, + 4, + "INT" + ], + [ + 26, + 18, + 0, + 10, + 4, + "INT" + ], + [ + 27, + 10, + 0, + 19, + 0, + "LATENT" + ], + [ + 28, + 6, + 2, + 19, + 1, + "VAE" + ], + [ + 29, + 19, + 0, + 20, + 0, + "IMAGE" + ], + [ + 30, + 21, + 0, + 22, + 0, + "IMAGE" + ], + [ + 31, + 15, + 0, + 21, + 0, + "LATENT" + ], + [ + 32, + 6, + 2, + 21, + 1, + "VAE" + ], + [ + 34, + 24, + 0, + 8, + 0, + "IMAGE" + ] + ], + "groups": [ + { + "id": 1, + "title": "Prompt", + "bounding": [ + -610, + -250, + 420.412841796875, + 540.5933227539062 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 2, + "title": "No LoRA", + "bounding": [ + -170, + -250, + 760, + 350 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 3, + "title": "With LoRA", + "bounding": [ + -170, + 120, + 754.0010986328125, + 345.6000061035156 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + }, + { + "id": 4, + "title": "group", + "bounding": [ + -970, + -250, + 340, + 580 + ], + "color": "#3f789e", + "font_size": 24, + "flags": {} + } + ], + "config": {}, + "extra": { + "ds": { + "scale": 0.7736437382254376, + "offset": [ + 1500.6912435822478, + 1006.0140975443438 + ] + }, + "frontendVersion": "1.21.7" + }, + "version": 0.4 +} \ No newline at end of file