From 37b76caccfa7fa44ff00d7bcb917bf350629f0ca Mon Sep 17 00:00:00 2001 From: Millun Atluri Date: Wed, 20 Dec 2023 17:42:14 +1100 Subject: [PATCH 01/15] Added default workflows --- ...SRGAN Upscaling with Canny ControlNet.json | 1364 +++++++++++++++ .../Multi ControlNet (Canny & Depth).json | 1480 +++++++++++++++++ .../default_workflows/Prompt from File.json | 975 +++++++++++ 3 files changed, 3819 insertions(+) create mode 100644 invokeai/app/services/workflow_records/default_workflows/ESRGAN Upscaling with Canny ControlNet.json create mode 100644 invokeai/app/services/workflow_records/default_workflows/Multi ControlNet (Canny & Depth).json create mode 100644 invokeai/app/services/workflow_records/default_workflows/Prompt from File.json diff --git a/invokeai/app/services/workflow_records/default_workflows/ESRGAN Upscaling with Canny ControlNet.json b/invokeai/app/services/workflow_records/default_workflows/ESRGAN Upscaling with Canny ControlNet.json new file mode 100644 index 0000000000..5c2d200ec2 --- /dev/null +++ b/invokeai/app/services/workflow_records/default_workflows/ESRGAN Upscaling with Canny ControlNet.json @@ -0,0 +1,1364 @@ +{ + "id": "6bfa0b3a-7090-4cd9-ad2d-a4b8662b6e71", + "name": "ESRGAN Upscaling with Canny ControlNet", + "author": "InvokeAI", + "description": "Sample workflow for using Upscaling with ControlNet with SD1.5", + "version": "1.0.1", + "contact": "invoke@invoke.ai", + "tags": "upscale, controlnet, default", + "notes": "", + "exposedFields": [ + { + "nodeId": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "fieldName": "model" + }, + { + "nodeId": "63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16b", + "fieldName": "prompt" + }, + { + "nodeId": "771bdf6a-0813-4099-a5d8-921a138754d4", + "fieldName": "image" + } + ], + "meta": { + "category": "default", + "version": "2.0.0" + }, + "nodes": [ + { + "id": "e8bf67fe-67de-4227-87eb-79e86afdfc74", + "type": "invocation", + "data": { + "id": "e8bf67fe-67de-4227-87eb-79e86afdfc74", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "5f762fae-d791-42d9-8ab5-2b830c33ff20", + "name": "prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "8ac95f40-317d-4513-bbba-b99effd3b438", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "46c65b2b-c0b5-40c2-b183-74e9451c6d56", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 1250, + "y": 1500 + } + }, + { + "id": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "type": "invocation", + "data": { + "id": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "type": "main_model_loader", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "model": { + "id": "b35ae88a-f2d2-43f6-958c-8c624391250f", + "name": "model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MainModelField" + }, + "value": { + "model_name": "stable-diffusion-v1-5", + "base_model": "sd-1", + "model_type": "main" + } + } + }, + "outputs": { + "unet": { + "id": "02f243cb-c6e2-42c5-8be9-ef0519d54383", + "name": "unet", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "clip": { + "id": "7762ed13-5b28-40f4-85f1-710942ceb92a", + "name": "clip", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + }, + "vae": { + "id": "69566153-1918-417d-a3bb-32e9e857ef6b", + "name": "vae", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + } + } + }, + "width": 320, + "height": 227, + "position": { + "x": 700, + "y": 1375 + } + }, + { + "id": "771bdf6a-0813-4099-a5d8-921a138754d4", + "type": "invocation", + "data": { + "id": "771bdf6a-0813-4099-a5d8-921a138754d4", + "type": "image", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "0f6d68a2-38bd-4f65-a112-0a256c7a2678", + "name": "image", + "fieldKind": "input", + "label": "Image To Upscale", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + } + }, + "outputs": { + "image": { + "id": "76f6f9b6-755b-4373-93fa-6a779998d2c8", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "6858e46b-707c-444f-beda-9b5f4aecfdf8", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "421bdc6e-ecd1-4935-9665-d38ab8314f79", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 225, + "position": { + "x": 375, + "y": 1900 + } + }, + { + "id": "f7564dd2-9539-47f2-ac13-190804461f4e", + "type": "invocation", + "data": { + "id": "f7564dd2-9539-47f2-ac13-190804461f4e", + "type": "esrgan", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.3.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "8fa0c7eb-5bd3-4575-98e7-72285c532504", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "3c949799-a504-41c9-b342-cff4b8146c48", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "model_name": { + "id": "77cb4750-53d6-4c2c-bb5c-145981acbf17", + "name": "model_name", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "RealESRGAN_x4plus.pth" + }, + "tile_size": { + "id": "7787b3ad-46ee-4248-995f-bc740e1f988b", + "name": "tile_size", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 400 + } + }, + "outputs": { + "image": { + "id": "37e6308e-e926-4e07-b0db-4e8601f495d0", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "c194d84a-fac7-4856-b646-d08477a5ad2b", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "b2a6206c-a9c8-4271-a055-0b93a7f7d505", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 775, + "y": 1900 + } + }, + { + "id": "1d887701-df21-4966-ae6e-a7d82307d7bd", + "type": "invocation", + "data": { + "id": "1d887701-df21-4966-ae6e-a7d82307d7bd", + "type": "canny_image_processor", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "52c877c8-25d9-4949-8518-f536fcdd152d", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "e0af11fe-4f95-4193-a599-cf40b6a963f5", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "low_threshold": { + "id": "ab775f7b-f556-4298-a9d6-2274f3a6c77c", + "name": "low_threshold", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 100 + }, + "high_threshold": { + "id": "9e58b615-06e4-417f-b0d8-63f1574cd174", + "name": "high_threshold", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 200 + } + }, + "outputs": { + "image": { + "id": "61feb8bf-95c9-4634-87e2-887fc43edbdf", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "9e203e41-73f7-4cfa-bdca-5040e5e60c55", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "ec7d99dc-0d82-4495-a759-6423808bff1c", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 1200, + "y": 1900 + } + }, + { + "id": "ca1d020c-89a8-4958-880a-016d28775cfa", + "type": "invocation", + "data": { + "id": "ca1d020c-89a8-4958-880a-016d28775cfa", + "type": "controlnet", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.1.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "2973c126-e301-4595-a7dc-d6e1729ccdbf", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "control_model": { + "id": "4bb4d987-8491-4839-b41b-6e2f546fe2d0", + "name": "control_model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlNetModelField" + }, + "value": { + "model_name": "sd-controlnet-canny", + "base_model": "sd-1" + } + }, + "control_weight": { + "id": "a3cf387a-b58f-4058-858f-6a918efac609", + "name": "control_weight", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 1 + }, + "begin_step_percent": { + "id": "e0614f69-8a58-408b-9238-d3a44a4db4e0", + "name": "begin_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "end_step_percent": { + "id": "ac683539-b6ed-4166-9294-2040e3ede206", + "name": "end_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "control_mode": { + "id": "f00b21de-cbd7-4901-8efc-e7134a2dc4c8", + "name": "control_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "balanced" + }, + "resize_mode": { + "id": "cafb60ee-3959-4d57-a06c-13b83be6ea4f", + "name": "resize_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "just_resize" + } + }, + "outputs": { + "control": { + "id": "dfb88dd1-12bf-4034-9268-e726f894c131", + "name": "control", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlField" + } + } + } + }, + "width": 320, + "height": 511, + "position": { + "x": 1650, + "y": 1900 + } + }, + { + "id": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "invocation", + "data": { + "id": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "noise", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.1", + "nodePack": "invokeai", + "inputs": { + "seed": { + "id": "f76b0e01-b601-423f-9b5f-ab7a1f10fe82", + "name": "seed", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "width": { + "id": "eec326d6-710c-45de-a25c-95704c80d7e2", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "2794a27d-5337-43ca-95d9-41b673642c94", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "use_cpu": { + "id": "ae7654e3-979e-44a1-8968-7e3199e91e66", + "name": "use_cpu", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "noise": { + "id": "8b6dc166-4ead-4124-8ac9-529814b0cbb9", + "name": "noise", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "e3fe3940-a277-4838-a448-5f81f2a7d99d", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "48ecd6ef-c216-40d5-9d1b-d37bd00c82e7", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 1650, + "y": 1775 + } + }, + { + "id": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "invocation", + "data": { + "id": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "denoise_latents", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.5.0", + "nodePack": "invokeai", + "inputs": { + "positive_conditioning": { + "id": "e127084b-72f5-4fe4-892b-84f34f88bce9", + "name": "positive_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "negative_conditioning": { + "id": "72cde4ee-55de-4d3e-9057-74e741c04e20", + "name": "negative_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "noise": { + "id": "747f7023-1c19-465b-bec8-1d9695dd3505", + "name": "noise", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "steps": { + "id": "80860292-633c-46f2-83d0-60d0029b65d2", + "name": "steps", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 10 + }, + "cfg_scale": { + "id": "ebc71e6f-9148-4f12-b455-5e1f179d1c3a", + "name": "cfg_scale", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 7.5 + }, + "denoising_start": { + "id": "ced44b8f-3bad-4c34-8113-13bc0faed28a", + "name": "denoising_start", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "denoising_end": { + "id": "79bf4b77-3502-4f72-ba8b-269c4c3c5c72", + "name": "denoising_end", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "scheduler": { + "id": "ed56e2b8-f477-41a2-b9f5-f15f4933ae65", + "name": "scheduler", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "SchedulerField" + }, + "value": "euler" + }, + "unet": { + "id": "146b790c-b08e-437c-a2e1-e393c2c1c41a", + "name": "unet", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "control": { + "id": "75ed3df1-d261-4b8e-a89b-341c4d7161fb", + "name": "control", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "ControlField" + } + }, + "ip_adapter": { + "id": "eab9a61d-9b64-44d3-8d90-4686f5887cb0", + "name": "ip_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "IPAdapterField" + } + }, + "t2i_adapter": { + "id": "2dc8d637-58fd-4069-ad33-85c32d958b7b", + "name": "t2i_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "T2IAdapterField" + } + }, + "cfg_rescale_multiplier": { + "id": "391e5010-e402-4380-bb46-e7edaede3512", + "name": "cfg_rescale_multiplier", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "latents": { + "id": "6767e40a-97c6-4487-b3c9-cad1c150bf9f", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "denoise_mask": { + "id": "6251efda-d97d-4ff1-94b5-8cc6b458c184", + "name": "denoise_mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "DenoiseMaskField" + } + } + }, + "outputs": { + "latents": { + "id": "4e7986a4-dff2-4448-b16b-1af477b81f8b", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "dad525dd-d2f8-4f07-8c8d-51f2a3c5456e", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "af03a089-4739-40c6-8b48-25d458d63c2f", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 705, + "position": { + "x": 2128.740065979906, + "y": 1232.6219060454753 + } + }, + { + "id": "3ed9b2ef-f4ec-40a7-94db-92e63b583ec0", + "type": "invocation", + "data": { + "id": "3ed9b2ef-f4ec-40a7-94db-92e63b583ec0", + "type": "l2i", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": false, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "9f7a1a9f-7861-4f09-874b-831af89b7474", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "latents": { + "id": "a5b42432-8ee7-48cd-b61c-b97be6e490a2", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "vae": { + "id": "890de106-e6c3-4c2c-8d67-b368def64894", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "b8e5a2ca-5fbc-49bd-ad4c-ea0e109d46e3", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "fdaf6264-4593-4bd2-ac71-8a0acff261af", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "94c5877d-6c78-4662-a836-8a84fc75d0a0", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "2a854e42-1616-42f5-b9ef-7b73c40afc1d", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "dd649053-1433-4f31-90b3-8bb103efc5b1", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 267, + "position": { + "x": 2559.4751127537957, + "y": 1246.6000376741406 + } + }, + { + "id": "5ca498a4-c8c8-4580-a396-0c984317205d", + "type": "invocation", + "data": { + "id": "5ca498a4-c8c8-4580-a396-0c984317205d", + "type": "i2l", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "9e6c4010-0f79-4587-9062-29d9a8f96b3b", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "vae": { + "id": "b9ed2ec4-e8e3-4d69-8a42-27f2d983bcd6", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "bb48d10b-2440-4c46-b835-646ae5ebc013", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "1048612c-c0f4-4abf-a684-0045e7d158f8", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "latents": { + "id": "55301367-0578-4dee-8060-031ae13c7bf8", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "2eb65690-1f20-4070-afbd-1e771b9f8ca9", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "d5bf64c7-c30f-43b8-9bc2-95e7718c1bdc", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 1650, + "y": 1675 + } + }, + { + "id": "63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16b", + "type": "invocation", + "data": { + "id": "63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16b", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "5f762fae-d791-42d9-8ab5-2b830c33ff20", + "name": "prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "8ac95f40-317d-4513-bbba-b99effd3b438", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "46c65b2b-c0b5-40c2-b183-74e9451c6d56", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 1250, + "y": 1200 + } + }, + { + "id": "eb8f6f8a-c7b1-4914-806e-045ee2717a35", + "type": "invocation", + "data": { + "id": "eb8f6f8a-c7b1-4914-806e-045ee2717a35", + "type": "rand_int", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": false, + "version": "1.0.0", + "inputs": { + "low": { + "id": "2118026f-1c64-41fa-ab6b-7532410f60ae", + "name": "low", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "high": { + "id": "c12f312a-fdfd-4aca-9aa6-4c99bc70bd63", + "name": "high", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 2147483647 + } + }, + "outputs": { + "value": { + "id": "75552bad-6212-4ae7-96a7-68e666acea4c", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 1650, + "y": 1600 + } + } + ], + "edges": [ + { + "id": "5ca498a4-c8c8-4580-a396-0c984317205d-f50624ce-82bf-41d0-bdf7-8aab11a80d48-collapsed", + "source": "5ca498a4-c8c8-4580-a396-0c984317205d", + "target": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "collapsed" + }, + { + "id": "eb8f6f8a-c7b1-4914-806e-045ee2717a35-f50624ce-82bf-41d0-bdf7-8aab11a80d48-collapsed", + "source": "eb8f6f8a-c7b1-4914-806e-045ee2717a35", + "target": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "collapsed" + }, + { + "id": "reactflow__edge-771bdf6a-0813-4099-a5d8-921a138754d4image-f7564dd2-9539-47f2-ac13-190804461f4eimage", + "source": "771bdf6a-0813-4099-a5d8-921a138754d4", + "target": "f7564dd2-9539-47f2-ac13-190804461f4e", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-f7564dd2-9539-47f2-ac13-190804461f4eimage-1d887701-df21-4966-ae6e-a7d82307d7bdimage", + "source": "f7564dd2-9539-47f2-ac13-190804461f4e", + "target": "1d887701-df21-4966-ae6e-a7d82307d7bd", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-5ca498a4-c8c8-4580-a396-0c984317205dwidth-f50624ce-82bf-41d0-bdf7-8aab11a80d48width", + "source": "5ca498a4-c8c8-4580-a396-0c984317205d", + "target": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "default", + "sourceHandle": "width", + "targetHandle": "width" + }, + { + "id": "reactflow__edge-5ca498a4-c8c8-4580-a396-0c984317205dheight-f50624ce-82bf-41d0-bdf7-8aab11a80d48height", + "source": "5ca498a4-c8c8-4580-a396-0c984317205d", + "target": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "default", + "sourceHandle": "height", + "targetHandle": "height" + }, + { + "id": "reactflow__edge-f50624ce-82bf-41d0-bdf7-8aab11a80d48noise-c3737554-8d87-48ff-a6f8-e71d2867f434noise", + "source": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "target": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "default", + "sourceHandle": "noise", + "targetHandle": "noise" + }, + { + "id": "reactflow__edge-5ca498a4-c8c8-4580-a396-0c984317205dlatents-c3737554-8d87-48ff-a6f8-e71d2867f434latents", + "source": "5ca498a4-c8c8-4580-a396-0c984317205d", + "target": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-e8bf67fe-67de-4227-87eb-79e86afdfc74conditioning-c3737554-8d87-48ff-a6f8-e71d2867f434negative_conditioning", + "source": "e8bf67fe-67de-4227-87eb-79e86afdfc74", + "target": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "negative_conditioning" + }, + { + "id": "reactflow__edge-63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16bconditioning-c3737554-8d87-48ff-a6f8-e71d2867f434positive_conditioning", + "source": "63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16b", + "target": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "positive_conditioning" + }, + { + "id": "reactflow__edge-d8ace142-c05f-4f1d-8982-88dc7473958dclip-63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16bclip", + "source": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "target": "63b6ab7e-5b05-4d1b-a3b1-42d8e53ce16b", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-d8ace142-c05f-4f1d-8982-88dc7473958dclip-e8bf67fe-67de-4227-87eb-79e86afdfc74clip", + "source": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "target": "e8bf67fe-67de-4227-87eb-79e86afdfc74", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-1d887701-df21-4966-ae6e-a7d82307d7bdimage-ca1d020c-89a8-4958-880a-016d28775cfaimage", + "source": "1d887701-df21-4966-ae6e-a7d82307d7bd", + "target": "ca1d020c-89a8-4958-880a-016d28775cfa", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-ca1d020c-89a8-4958-880a-016d28775cfacontrol-c3737554-8d87-48ff-a6f8-e71d2867f434control", + "source": "ca1d020c-89a8-4958-880a-016d28775cfa", + "target": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "default", + "sourceHandle": "control", + "targetHandle": "control" + }, + { + "id": "reactflow__edge-c3737554-8d87-48ff-a6f8-e71d2867f434latents-3ed9b2ef-f4ec-40a7-94db-92e63b583ec0latents", + "source": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "target": "3ed9b2ef-f4ec-40a7-94db-92e63b583ec0", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-d8ace142-c05f-4f1d-8982-88dc7473958dvae-3ed9b2ef-f4ec-40a7-94db-92e63b583ec0vae", + "source": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "target": "3ed9b2ef-f4ec-40a7-94db-92e63b583ec0", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + }, + { + "id": "reactflow__edge-f7564dd2-9539-47f2-ac13-190804461f4eimage-5ca498a4-c8c8-4580-a396-0c984317205dimage", + "source": "f7564dd2-9539-47f2-ac13-190804461f4e", + "target": "5ca498a4-c8c8-4580-a396-0c984317205d", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-d8ace142-c05f-4f1d-8982-88dc7473958dunet-c3737554-8d87-48ff-a6f8-e71d2867f434unet", + "source": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "target": "c3737554-8d87-48ff-a6f8-e71d2867f434", + "type": "default", + "sourceHandle": "unet", + "targetHandle": "unet" + }, + { + "id": "reactflow__edge-d8ace142-c05f-4f1d-8982-88dc7473958dvae-5ca498a4-c8c8-4580-a396-0c984317205dvae", + "source": "d8ace142-c05f-4f1d-8982-88dc7473958d", + "target": "5ca498a4-c8c8-4580-a396-0c984317205d", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + }, + { + "id": "reactflow__edge-eb8f6f8a-c7b1-4914-806e-045ee2717a35value-f50624ce-82bf-41d0-bdf7-8aab11a80d48seed", + "source": "eb8f6f8a-c7b1-4914-806e-045ee2717a35", + "target": "f50624ce-82bf-41d0-bdf7-8aab11a80d48", + "type": "default", + "sourceHandle": "value", + "targetHandle": "seed" + } + ] +} \ No newline at end of file diff --git a/invokeai/app/services/workflow_records/default_workflows/Multi ControlNet (Canny & Depth).json b/invokeai/app/services/workflow_records/default_workflows/Multi ControlNet (Canny & Depth).json new file mode 100644 index 0000000000..8bd6aef135 --- /dev/null +++ b/invokeai/app/services/workflow_records/default_workflows/Multi ControlNet (Canny & Depth).json @@ -0,0 +1,1480 @@ +{ + "id": "1e385b84-86f8-452e-9697-9e5abed20518", + "name": "Multi ControlNet (Canny & Depth)", + "author": "InvokeAI", + "description": "A sample workflow using canny & depth ControlNets to guide the generation process. ", + "version": "1.0.0", + "contact": "invoke@invoke.ai", + "tags": "ControlNet, canny, depth", + "notes": "", + "exposedFields": [ + { + "nodeId": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "fieldName": "model" + }, + { + "nodeId": "7ce68934-3419-42d4-ac70-82cfc9397306", + "fieldName": "prompt" + }, + { + "nodeId": "273e3f96-49ea-4dc5-9d5b-9660390f14e1", + "fieldName": "prompt" + }, + { + "nodeId": "c4b23e64-7986-40c4-9cad-46327b12e204", + "fieldName": "image" + }, + { + "nodeId": "8e860e51-5045-456e-bf04-9a62a2a5c49e", + "fieldName": "image" + } + ], + "meta": { + "category": "default", + "version": "2.0.0" + }, + "nodes": [ + { + "id": "8e860e51-5045-456e-bf04-9a62a2a5c49e", + "type": "invocation", + "data": { + "id": "8e860e51-5045-456e-bf04-9a62a2a5c49e", + "type": "image", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "189c8adf-68cc-4774-a729-49da89f6fdf1", + "name": "image", + "fieldKind": "input", + "label": "Depth Input Image", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + } + }, + "outputs": { + "image": { + "id": "1a31cacd-9d19-4f32-b558-c5e4aa39ce73", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "12f298fd-1d11-4cca-9426-01240f7ec7cf", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "c47dabcb-44e8-40c9-992d-81dca59f598e", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 225, + "position": { + "x": 3625, + "y": -75 + } + }, + { + "id": "a33199c2-8340-401e-b8a2-42ffa875fc1c", + "type": "invocation", + "data": { + "id": "a33199c2-8340-401e-b8a2-42ffa875fc1c", + "type": "controlnet", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.1.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "4e0a3172-d3c2-4005-a84c-fa12a404f8a0", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "control_model": { + "id": "8cb2d998-4086-430a-8b13-94cbc81e3ca3", + "name": "control_model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlNetModelField" + }, + "value": { + "model_name": "sd-controlnet-depth", + "base_model": "sd-1" + } + }, + "control_weight": { + "id": "5e32bd8a-9dc8-42d8-9bcc-c2b0460c0b0f", + "name": "control_weight", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 1 + }, + "begin_step_percent": { + "id": "c258a276-352a-416c-8358-152f11005c0c", + "name": "begin_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "end_step_percent": { + "id": "43001125-0d70-4f87-8e79-da6603ad6c33", + "name": "end_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "control_mode": { + "id": "d2f14561-9443-4374-9270-e2f05007944e", + "name": "control_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "balanced" + }, + "resize_mode": { + "id": "727ee7d3-8bf6-4c7d-8b8a-43546b3b59cd", + "name": "resize_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "just_resize" + } + }, + "outputs": { + "control": { + "id": "b034aa0f-4d0d-46e4-b5e3-e25a9588d087", + "name": "control", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlField" + } + } + } + }, + "width": 320, + "height": 511, + "position": { + "x": 4477.604342844504, + "y": -49.39005411272677 + } + }, + { + "id": "273e3f96-49ea-4dc5-9d5b-9660390f14e1", + "type": "invocation", + "data": { + "id": "273e3f96-49ea-4dc5-9d5b-9660390f14e1", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "7c2c4771-2161-4d77-aced-ff8c4b3f1c15", + "name": "prompt", + "fieldKind": "input", + "label": "Negative Prompt", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "06d59e91-9cca-411d-bf05-86b099b3e8f7", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "858bc33c-134c-4bf6-8855-f943e1d26f14", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 4075, + "y": -825 + } + }, + { + "id": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "type": "invocation", + "data": { + "id": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "type": "main_model_loader", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "model": { + "id": "f4a915a5-593e-4b6d-9198-c78eb5cefaed", + "name": "model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MainModelField" + }, + "value": { + "model_name": "stable-diffusion-v1-5", + "base_model": "sd-1", + "model_type": "main" + } + } + }, + "outputs": { + "unet": { + "id": "ee24fb16-da38-4c66-9fbc-e8f296ed40d2", + "name": "unet", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "clip": { + "id": "f3fb0524-8803-41c1-86db-a61a13ee6a33", + "name": "clip", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + }, + "vae": { + "id": "5c4878a8-b40f-44ab-b146-1c1f42c860b3", + "name": "vae", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + } + } + }, + "width": 320, + "height": 227, + "position": { + "x": 3600, + "y": -1000 + } + }, + { + "id": "7ce68934-3419-42d4-ac70-82cfc9397306", + "type": "invocation", + "data": { + "id": "7ce68934-3419-42d4-ac70-82cfc9397306", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "7c2c4771-2161-4d77-aced-ff8c4b3f1c15", + "name": "prompt", + "fieldKind": "input", + "label": "Positive Prompt", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "06d59e91-9cca-411d-bf05-86b099b3e8f7", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "858bc33c-134c-4bf6-8855-f943e1d26f14", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 4075, + "y": -1125 + } + }, + { + "id": "d204d184-f209-4fae-a0a1-d152800844e1", + "type": "invocation", + "data": { + "id": "d204d184-f209-4fae-a0a1-d152800844e1", + "type": "controlnet", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.1.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "4e0a3172-d3c2-4005-a84c-fa12a404f8a0", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "control_model": { + "id": "8cb2d998-4086-430a-8b13-94cbc81e3ca3", + "name": "control_model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlNetModelField" + }, + "value": { + "model_name": "sd-controlnet-canny", + "base_model": "sd-1" + } + }, + "control_weight": { + "id": "5e32bd8a-9dc8-42d8-9bcc-c2b0460c0b0f", + "name": "control_weight", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 1 + }, + "begin_step_percent": { + "id": "c258a276-352a-416c-8358-152f11005c0c", + "name": "begin_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "end_step_percent": { + "id": "43001125-0d70-4f87-8e79-da6603ad6c33", + "name": "end_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "control_mode": { + "id": "d2f14561-9443-4374-9270-e2f05007944e", + "name": "control_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "balanced" + }, + "resize_mode": { + "id": "727ee7d3-8bf6-4c7d-8b8a-43546b3b59cd", + "name": "resize_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "just_resize" + } + }, + "outputs": { + "control": { + "id": "b034aa0f-4d0d-46e4-b5e3-e25a9588d087", + "name": "control", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlField" + } + } + } + }, + "width": 320, + "height": 511, + "position": { + "x": 4479.68542130465, + "y": -618.4221638099414 + } + }, + { + "id": "c4b23e64-7986-40c4-9cad-46327b12e204", + "type": "invocation", + "data": { + "id": "c4b23e64-7986-40c4-9cad-46327b12e204", + "type": "image", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "189c8adf-68cc-4774-a729-49da89f6fdf1", + "name": "image", + "fieldKind": "input", + "label": "Canny Input Image", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + } + }, + "outputs": { + "image": { + "id": "1a31cacd-9d19-4f32-b558-c5e4aa39ce73", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "12f298fd-1d11-4cca-9426-01240f7ec7cf", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "c47dabcb-44e8-40c9-992d-81dca59f598e", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 225, + "position": { + "x": 3625, + "y": -425 + } + }, + { + "id": "ca4d5059-8bfb-447f-b415-da0faba5a143", + "type": "invocation", + "data": { + "id": "ca4d5059-8bfb-447f-b415-da0faba5a143", + "type": "collect", + "label": "ControlNet Collection", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "inputs": { + "item": { + "id": "b16ae602-8708-4b1b-8d4f-9e0808d429ab", + "name": "item", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "CollectionItemField" + } + } + }, + "outputs": { + "collection": { + "id": "d8987dd8-dec8-4d94-816a-3e356af29884", + "name": "collection", + "fieldKind": "output", + "type": { + "isCollection": true, + "isCollectionOrScalar": false, + "name": "CollectionField" + } + } + } + }, + "width": 320, + "height": 104, + "position": { + "x": 4875, + "y": -575 + } + }, + { + "id": "018b1214-c2af-43a7-9910-fb687c6726d7", + "type": "invocation", + "data": { + "id": "018b1214-c2af-43a7-9910-fb687c6726d7", + "type": "midas_depth_image_processor", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "77f91980-c696-4a18-a9ea-6e2fc329a747", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "50710a20-2af5-424d-9d17-aa08167829c6", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "a_mult": { + "id": "f3b26f9d-2498-415e-9c01-197a8d06c0a5", + "name": "a_mult", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 2 + }, + "bg_th": { + "id": "4b1eb3ae-9d4a-47d6-b0ed-da62501e007f", + "name": "bg_th", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.1 + } + }, + "outputs": { + "image": { + "id": "b4ed637c-c4a0-4fdd-a24e-36d6412e4ccf", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "6bf9b609-d72c-4239-99bd-390a73cc3a9c", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "3e8aef09-cf44-4e3e-a490-d3c9e7b23119", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 4100, + "y": -75 + } + }, + { + "id": "c826ba5e-9676-4475-b260-07b85e88753c", + "type": "invocation", + "data": { + "id": "c826ba5e-9676-4475-b260-07b85e88753c", + "type": "canny_image_processor", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "08331ea6-99df-4e61-a919-204d9bfa8fb2", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "33a37284-06ac-459c-ba93-1655e4f69b2d", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "low_threshold": { + "id": "21ec18a3-50c5-4ba1-9642-f921744d594f", + "name": "low_threshold", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 100 + }, + "high_threshold": { + "id": "ebeab271-a5ff-4c88-acfd-1d0271ab6ed4", + "name": "high_threshold", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 200 + } + }, + "outputs": { + "image": { + "id": "c0caadbf-883f-4cb4-a62d-626b9c81fc4e", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "df225843-8098-49c0-99d1-3b0b6600559f", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "e4abe0de-aa16-41f3-9cd7-968b49db5da3", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 4095.757337055795, + "y": -455.63440891935863 + } + }, + { + "id": "9db25398-c869-4a63-8815-c6559341ef12", + "type": "invocation", + "data": { + "id": "9db25398-c869-4a63-8815-c6559341ef12", + "type": "l2i", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": false, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "2f269793-72e5-4ff3-b76c-fab4f93e983f", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "latents": { + "id": "4aaedd3b-cc77-420c-806e-c7fa74ec4cdf", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "vae": { + "id": "432b066a-2462-4d18-83d9-64620b72df45", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "61f86e0f-7c46-40f8-b3f5-fe2f693595ca", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "39b6c89a-37ef-4a7e-9509-daeca49d5092", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "6204e9b0-61dd-4250-b685-2092ba0e28e6", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "b4140649-8d5d-4d2d-bfa6-09e389ede5f9", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "f3a0c0c8-fc24-4646-8be1-ed8cdd140828", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 267, + "position": { + "x": 5675, + "y": -825 + } + }, + { + "id": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "invocation", + "data": { + "id": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "denoise_latents", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.5.0", + "nodePack": "invokeai", + "inputs": { + "positive_conditioning": { + "id": "869cd309-c238-444b-a1a0-5021f99785ba", + "name": "positive_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "negative_conditioning": { + "id": "343447b4-1e37-4e9e-8ac7-4d04864066af", + "name": "negative_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "noise": { + "id": "b556571e-0cf9-4e03-8cfc-5caad937d957", + "name": "noise", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "steps": { + "id": "a3b3d2de-9308-423e-b00d-c209c3e6e808", + "name": "steps", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 10 + }, + "cfg_scale": { + "id": "b13c50a4-ec7e-4579-b0ef-2fe5df2605ea", + "name": "cfg_scale", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 7.5 + }, + "denoising_start": { + "id": "57d5d755-f58f-4347-b991-f0bca4a0ab29", + "name": "denoising_start", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "denoising_end": { + "id": "323e78a6-880a-4d73-a62c-70faff965aa6", + "name": "denoising_end", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "scheduler": { + "id": "c25fdc17-a089-43ac-953e-067c45d5c76b", + "name": "scheduler", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "SchedulerField" + }, + "value": "euler" + }, + "unet": { + "id": "6cde662b-e633-4569-b6b4-ec87c52c9c11", + "name": "unet", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "control": { + "id": "276a4df9-bb26-4505-a4d3-a94e18c7b541", + "name": "control", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "ControlField" + } + }, + "ip_adapter": { + "id": "48d40c51-b5e2-4457-a428-eef0696695e8", + "name": "ip_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "IPAdapterField" + } + }, + "t2i_adapter": { + "id": "75dd8af2-e7d7-48b4-a574-edd9f6e686ad", + "name": "t2i_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "T2IAdapterField" + } + }, + "cfg_rescale_multiplier": { + "id": "b90460cf-d0c9-4676-8909-2e8e22dc8ee5", + "name": "cfg_rescale_multiplier", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "latents": { + "id": "9223d67b-1dd7-4b34-a45f-ed0a725d9702", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "denoise_mask": { + "id": "4ee99177-6923-4b7f-8fe0-d721dd7cb05b", + "name": "denoise_mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "DenoiseMaskField" + } + } + }, + "outputs": { + "latents": { + "id": "7fb4e326-a974-43e8-9ee7-2e3ab235819d", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "6bb8acd0-8973-4195-a095-e376385dc705", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "795dea52-1c7d-4e64-99f7-2f60ec6e3ab9", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 705, + "position": { + "x": 5274.672987098195, + "y": -823.0752416664332 + } + }, + { + "id": "2e77a0a1-db6a-47a2-a8bf-1e003be6423b", + "type": "invocation", + "data": { + "id": "2e77a0a1-db6a-47a2-a8bf-1e003be6423b", + "type": "noise", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.1", + "inputs": { + "seed": { + "id": "96d7667a-9c56-4fb4-99db-868e2f08e874", + "name": "seed", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "width": { + "id": "1ce644ea-c9bf-48c5-9822-bdec0d2895c5", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "26d68b53-8a04-4db7-b0f8-57c9bddc0e49", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "use_cpu": { + "id": "cf8fb92e-2a8e-4cd5-baf5-4011e0ddfa22", + "name": "use_cpu", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "noise": { + "id": "d9cb9305-6b3a-49a9-b27c-00fb3a58b85c", + "name": "noise", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "4ff28d00-ceee-42b8-90e7-f5e5a518376d", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "a6314b9c-346a-4aa6-9260-626ed46c060a", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 4875, + "y": -675 + } + }, + { + "id": "8b260b4d-3fd6-44d4-b1be-9f0e43c628ce", + "type": "invocation", + "data": { + "id": "8b260b4d-3fd6-44d4-b1be-9f0e43c628ce", + "type": "rand_int", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": false, + "version": "1.0.0", + "inputs": { + "low": { + "id": "a190ad12-a6bd-499b-a82a-100e09fe9aa4", + "name": "low", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "high": { + "id": "a085063f-b9ba-46f2-a21b-c46c321949aa", + "name": "high", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 2147483647 + } + }, + "outputs": { + "value": { + "id": "a15aff56-4874-47fe-be32-d66745ed2ab5", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 4875, + "y": -750 + } + } + ], + "edges": [ + { + "id": "8b260b4d-3fd6-44d4-b1be-9f0e43c628ce-2e77a0a1-db6a-47a2-a8bf-1e003be6423b-collapsed", + "source": "8b260b4d-3fd6-44d4-b1be-9f0e43c628ce", + "target": "2e77a0a1-db6a-47a2-a8bf-1e003be6423b", + "type": "collapsed" + }, + { + "id": "reactflow__edge-54486974-835b-4d81-8f82-05f9f32ce9e9clip-7ce68934-3419-42d4-ac70-82cfc9397306clip", + "source": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "target": "7ce68934-3419-42d4-ac70-82cfc9397306", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-54486974-835b-4d81-8f82-05f9f32ce9e9clip-273e3f96-49ea-4dc5-9d5b-9660390f14e1clip", + "source": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "target": "273e3f96-49ea-4dc5-9d5b-9660390f14e1", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-a33199c2-8340-401e-b8a2-42ffa875fc1ccontrol-ca4d5059-8bfb-447f-b415-da0faba5a143item", + "source": "a33199c2-8340-401e-b8a2-42ffa875fc1c", + "target": "ca4d5059-8bfb-447f-b415-da0faba5a143", + "type": "default", + "sourceHandle": "control", + "targetHandle": "item" + }, + { + "id": "reactflow__edge-d204d184-f209-4fae-a0a1-d152800844e1control-ca4d5059-8bfb-447f-b415-da0faba5a143item", + "source": "d204d184-f209-4fae-a0a1-d152800844e1", + "target": "ca4d5059-8bfb-447f-b415-da0faba5a143", + "type": "default", + "sourceHandle": "control", + "targetHandle": "item" + }, + { + "id": "reactflow__edge-8e860e51-5045-456e-bf04-9a62a2a5c49eimage-018b1214-c2af-43a7-9910-fb687c6726d7image", + "source": "8e860e51-5045-456e-bf04-9a62a2a5c49e", + "target": "018b1214-c2af-43a7-9910-fb687c6726d7", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-018b1214-c2af-43a7-9910-fb687c6726d7image-a33199c2-8340-401e-b8a2-42ffa875fc1cimage", + "source": "018b1214-c2af-43a7-9910-fb687c6726d7", + "target": "a33199c2-8340-401e-b8a2-42ffa875fc1c", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-c4b23e64-7986-40c4-9cad-46327b12e204image-c826ba5e-9676-4475-b260-07b85e88753cimage", + "source": "c4b23e64-7986-40c4-9cad-46327b12e204", + "target": "c826ba5e-9676-4475-b260-07b85e88753c", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-c826ba5e-9676-4475-b260-07b85e88753cimage-d204d184-f209-4fae-a0a1-d152800844e1image", + "source": "c826ba5e-9676-4475-b260-07b85e88753c", + "target": "d204d184-f209-4fae-a0a1-d152800844e1", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-54486974-835b-4d81-8f82-05f9f32ce9e9vae-9db25398-c869-4a63-8815-c6559341ef12vae", + "source": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "target": "9db25398-c869-4a63-8815-c6559341ef12", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + }, + { + "id": "reactflow__edge-ac481b7f-08bf-4a9d-9e0c-3a82ea5243celatents-9db25398-c869-4a63-8815-c6559341ef12latents", + "source": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "target": "9db25398-c869-4a63-8815-c6559341ef12", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-ca4d5059-8bfb-447f-b415-da0faba5a143collection-ac481b7f-08bf-4a9d-9e0c-3a82ea5243cecontrol", + "source": "ca4d5059-8bfb-447f-b415-da0faba5a143", + "target": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "default", + "sourceHandle": "collection", + "targetHandle": "control" + }, + { + "id": "reactflow__edge-54486974-835b-4d81-8f82-05f9f32ce9e9unet-ac481b7f-08bf-4a9d-9e0c-3a82ea5243ceunet", + "source": "54486974-835b-4d81-8f82-05f9f32ce9e9", + "target": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "default", + "sourceHandle": "unet", + "targetHandle": "unet" + }, + { + "id": "reactflow__edge-273e3f96-49ea-4dc5-9d5b-9660390f14e1conditioning-ac481b7f-08bf-4a9d-9e0c-3a82ea5243cenegative_conditioning", + "source": "273e3f96-49ea-4dc5-9d5b-9660390f14e1", + "target": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "negative_conditioning" + }, + { + "id": "reactflow__edge-7ce68934-3419-42d4-ac70-82cfc9397306conditioning-ac481b7f-08bf-4a9d-9e0c-3a82ea5243cepositive_conditioning", + "source": "7ce68934-3419-42d4-ac70-82cfc9397306", + "target": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "positive_conditioning" + }, + { + "id": "reactflow__edge-2e77a0a1-db6a-47a2-a8bf-1e003be6423bnoise-ac481b7f-08bf-4a9d-9e0c-3a82ea5243cenoise", + "source": "2e77a0a1-db6a-47a2-a8bf-1e003be6423b", + "target": "ac481b7f-08bf-4a9d-9e0c-3a82ea5243ce", + "type": "default", + "sourceHandle": "noise", + "targetHandle": "noise" + }, + { + "id": "reactflow__edge-8b260b4d-3fd6-44d4-b1be-9f0e43c628cevalue-2e77a0a1-db6a-47a2-a8bf-1e003be6423bseed", + "source": "8b260b4d-3fd6-44d4-b1be-9f0e43c628ce", + "target": "2e77a0a1-db6a-47a2-a8bf-1e003be6423b", + "type": "default", + "sourceHandle": "value", + "targetHandle": "seed" + } + ] +} \ No newline at end of file diff --git a/invokeai/app/services/workflow_records/default_workflows/Prompt from File.json b/invokeai/app/services/workflow_records/default_workflows/Prompt from File.json new file mode 100644 index 0000000000..08e76fd793 --- /dev/null +++ b/invokeai/app/services/workflow_records/default_workflows/Prompt from File.json @@ -0,0 +1,975 @@ +{ + "name": "Prompt from File", + "author": "InvokeAI", + "description": "Sample workflow using Prompt from File node", + "version": "0.1.0", + "contact": "invoke@invoke.ai", + "tags": "text2image, prompt from file, default", + "notes": "", + "exposedFields": [ + { + "nodeId": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "fieldName": "model" + }, + { + "nodeId": "1b7e0df8-8589-4915-a4ea-c0088f15d642", + "fieldName": "file_path" + } + ], + "meta": { + "category": "default", + "version": "2.0.0" + }, + "id": "d1609af5-eb0a-4f73-b573-c9af96a8d6bf", + "nodes": [ + { + "id": "c2eaf1ba-5708-4679-9e15-945b8b432692", + "type": "invocation", + "data": { + "id": "c2eaf1ba-5708-4679-9e15-945b8b432692", + "type": "compel", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "dcdf3f6d-9b96-4bcd-9b8d-f992fefe4f62", + "name": "prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "3f1981c9-d8a9-42eb-a739-4f120eb80745", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "46205e6c-c5e2-44cb-9c82-1cd20b95674a", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 925, + "y": -200 + } + }, + { + "id": "1b7e0df8-8589-4915-a4ea-c0088f15d642", + "type": "invocation", + "data": { + "id": "1b7e0df8-8589-4915-a4ea-c0088f15d642", + "type": "prompt_from_file", + "label": "Prompts from File", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.1", + "nodePack": "invokeai", + "inputs": { + "file_path": { + "id": "37e37684-4f30-4ec8-beae-b333e550f904", + "name": "file_path", + "fieldKind": "input", + "label": "Prompts File Path", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "pre_prompt": { + "id": "7de02feb-819a-4992-bad3-72a30920ddea", + "name": "pre_prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "post_prompt": { + "id": "95f191d8-a282-428e-bd65-de8cb9b7513a", + "name": "post_prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "start_line": { + "id": "efee9a48-05ab-4829-8429-becfa64a0782", + "name": "start_line", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 1 + }, + "max_prompts": { + "id": "abebb428-3d3d-49fd-a482-4e96a16fff08", + "name": "max_prompts", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 1 + } + }, + "outputs": { + "collection": { + "id": "77d5d7f1-9877-4ab1-9a8c-33e9ffa9abf3", + "name": "collection", + "fieldKind": "output", + "type": { + "isCollection": true, + "isCollectionOrScalar": false, + "name": "StringField" + } + } + } + }, + "width": 320, + "height": 580, + "position": { + "x": 475, + "y": -400 + } + }, + { + "id": "1b89067c-3f6b-42c8-991f-e3055789b251", + "type": "invocation", + "data": { + "id": "1b89067c-3f6b-42c8-991f-e3055789b251", + "type": "iterate", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.1.0", + "inputs": { + "collection": { + "id": "4c564bf8-5ed6-441e-ad2c-dda265d5785f", + "name": "collection", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": true, + "isCollectionOrScalar": false, + "name": "CollectionField" + } + } + }, + "outputs": { + "item": { + "id": "36340f9a-e7a5-4afa-b4b5-313f4e292380", + "name": "item", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "CollectionItemField" + } + }, + "index": { + "id": "1beca95a-2159-460f-97ff-c8bab7d89336", + "name": "index", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "total": { + "id": "ead597b8-108e-4eda-88a8-5c29fa2f8df9", + "name": "total", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 925, + "y": -400 + } + }, + { + "id": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "type": "invocation", + "data": { + "id": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "type": "main_model_loader", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "model": { + "id": "3f264259-3418-47d5-b90d-b6600e36ae46", + "name": "model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MainModelField" + }, + "value": { + "model_name": "stable-diffusion-v1-5", + "base_model": "sd-1", + "model_type": "main" + } + } + }, + "outputs": { + "unet": { + "id": "8e182ea2-9d0a-4c02-9407-27819288d4b5", + "name": "unet", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "clip": { + "id": "d67d9d30-058c-46d5-bded-3d09d6d1aa39", + "name": "clip", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + }, + "vae": { + "id": "89641601-0429-4448-98d5-190822d920d8", + "name": "vae", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + } + } + }, + "width": 320, + "height": 227, + "position": { + "x": 0, + "y": -375 + } + }, + { + "id": "fc9d0e35-a6de-4a19-84e1-c72497c823f6", + "type": "invocation", + "data": { + "id": "fc9d0e35-a6de-4a19-84e1-c72497c823f6", + "type": "compel", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "dcdf3f6d-9b96-4bcd-9b8d-f992fefe4f62", + "name": "prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "3f1981c9-d8a9-42eb-a739-4f120eb80745", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "46205e6c-c5e2-44cb-9c82-1cd20b95674a", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 925, + "y": -275 + } + }, + { + "id": "0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77", + "type": "invocation", + "data": { + "id": "0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77", + "type": "noise", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.1", + "nodePack": "invokeai", + "inputs": { + "seed": { + "id": "b722d84a-eeee-484f-bef2-0250c027cb67", + "name": "seed", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "width": { + "id": "d5f8ce11-0502-4bfc-9a30-5757dddf1f94", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "f187d5ff-38a5-4c3f-b780-fc5801ef34af", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "use_cpu": { + "id": "12f112b8-8b76-4816-b79e-662edc9f9aa5", + "name": "use_cpu", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "noise": { + "id": "08576ad1-96d9-42d2-96ef-6f5c1961933f", + "name": "noise", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "f3e1f94a-258d-41ff-9789-bd999bd9f40d", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "6cefc357-4339-415e-a951-49b9c2be32f4", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 925, + "y": 25 + } + }, + { + "id": "dfc20e07-7aef-4fc0-a3a1-7bf68ec6a4e5", + "type": "invocation", + "data": { + "id": "dfc20e07-7aef-4fc0-a3a1-7bf68ec6a4e5", + "type": "rand_int", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": false, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "low": { + "id": "b9fc6cf1-469c-4037-9bf0-04836965826f", + "name": "low", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "high": { + "id": "06eac725-0f60-4ba2-b8cd-7ad9f757488c", + "name": "high", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 2147483647 + } + }, + "outputs": { + "value": { + "id": "df08c84e-7346-4e92-9042-9e5cb773aaff", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 925, + "y": -50 + } + }, + { + "id": "491ec988-3c77-4c37-af8a-39a0c4e7a2a1", + "type": "invocation", + "data": { + "id": "491ec988-3c77-4c37-af8a-39a0c4e7a2a1", + "type": "l2i", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "022e4b33-562b-438d-b7df-41c3fd931f40", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "latents": { + "id": "67cb6c77-a394-4a66-a6a9-a0a7dcca69ec", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "vae": { + "id": "7b3fd9ad-a4ef-4e04-89fa-3832a9902dbd", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "5ac5680d-3add-4115-8ec0-9ef5bb87493b", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "db8297f5-55f8-452f-98cf-6572c2582152", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "d8778d0c-592a-4960-9280-4e77e00a7f33", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "c8b0a75a-f5de-4ff2-9227-f25bb2b97bec", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "83c05fbf-76b9-49ab-93c4-fa4b10e793e4", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 267, + "position": { + "x": 2037.861329274915, + "y": -329.8393457509562 + } + }, + { + "id": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "type": "invocation", + "data": { + "id": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "type": "denoise_latents", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.5.0", + "nodePack": "invokeai", + "inputs": { + "positive_conditioning": { + "id": "751fb35b-3f23-45ce-af1c-053e74251337", + "name": "positive_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "negative_conditioning": { + "id": "b9dc06b6-7481-4db1-a8c2-39d22a5eacff", + "name": "negative_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "noise": { + "id": "6e15e439-3390-48a4-8031-01e0e19f0e1d", + "name": "noise", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "steps": { + "id": "bfdfb3df-760b-4d51-b17b-0abb38b976c2", + "name": "steps", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 10 + }, + "cfg_scale": { + "id": "47770858-322e-41af-8494-d8b63ed735f3", + "name": "cfg_scale", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 7.5 + }, + "denoising_start": { + "id": "2ba78720-ee02-4130-a348-7bc3531f790b", + "name": "denoising_start", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "denoising_end": { + "id": "a874dffb-d433-4d1a-9f59-af4367bb05e4", + "name": "denoising_end", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "scheduler": { + "id": "36e021ad-b762-4fe4-ad4d-17f0291c40b2", + "name": "scheduler", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "SchedulerField" + }, + "value": "euler" + }, + "unet": { + "id": "98d3282d-f9f6-4b5e-b9e8-58658f1cac78", + "name": "unet", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "control": { + "id": "f2ea3216-43d5-42b4-887f-36e8f7166d53", + "name": "control", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "ControlField" + } + }, + "ip_adapter": { + "id": "d0780610-a298-47c8-a54e-70e769e0dfe2", + "name": "ip_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "IPAdapterField" + } + }, + "t2i_adapter": { + "id": "fdb40970-185e-4ea8-8bb5-88f06f91f46a", + "name": "t2i_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "T2IAdapterField" + } + }, + "cfg_rescale_multiplier": { + "id": "3af2d8c5-de83-425c-a100-49cb0f1f4385", + "name": "cfg_rescale_multiplier", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "latents": { + "id": "e05b538a-1b5a-4aa5-84b1-fd2361289a81", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "denoise_mask": { + "id": "463a419e-df30-4382-8ffb-b25b25abe425", + "name": "denoise_mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "DenoiseMaskField" + } + } + }, + "outputs": { + "latents": { + "id": "559ee688-66cf-4139-8b82-3d3aa69995ce", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "0b4285c2-e8b9-48e5-98f6-0a49d3f98fd2", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "8b0881b9-45e5-47d5-b526-24b6661de0ee", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 705, + "position": { + "x": 1570.9941088179146, + "y": -407.6505491604564 + } + } + ], + "edges": [ + { + "id": "1b89067c-3f6b-42c8-991f-e3055789b251-fc9d0e35-a6de-4a19-84e1-c72497c823f6-collapsed", + "source": "1b89067c-3f6b-42c8-991f-e3055789b251", + "target": "fc9d0e35-a6de-4a19-84e1-c72497c823f6", + "type": "collapsed" + }, + { + "id": "dfc20e07-7aef-4fc0-a3a1-7bf68ec6a4e5-0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77-collapsed", + "source": "dfc20e07-7aef-4fc0-a3a1-7bf68ec6a4e5", + "target": "0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77", + "type": "collapsed" + }, + { + "id": "reactflow__edge-1b7e0df8-8589-4915-a4ea-c0088f15d642collection-1b89067c-3f6b-42c8-991f-e3055789b251collection", + "source": "1b7e0df8-8589-4915-a4ea-c0088f15d642", + "target": "1b89067c-3f6b-42c8-991f-e3055789b251", + "type": "default", + "sourceHandle": "collection", + "targetHandle": "collection" + }, + { + "id": "reactflow__edge-d6353b7f-b447-4e17-8f2e-80a88c91d426clip-fc9d0e35-a6de-4a19-84e1-c72497c823f6clip", + "source": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "target": "fc9d0e35-a6de-4a19-84e1-c72497c823f6", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-1b89067c-3f6b-42c8-991f-e3055789b251item-fc9d0e35-a6de-4a19-84e1-c72497c823f6prompt", + "source": "1b89067c-3f6b-42c8-991f-e3055789b251", + "target": "fc9d0e35-a6de-4a19-84e1-c72497c823f6", + "type": "default", + "sourceHandle": "item", + "targetHandle": "prompt" + }, + { + "id": "reactflow__edge-d6353b7f-b447-4e17-8f2e-80a88c91d426clip-c2eaf1ba-5708-4679-9e15-945b8b432692clip", + "source": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "target": "c2eaf1ba-5708-4679-9e15-945b8b432692", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-dfc20e07-7aef-4fc0-a3a1-7bf68ec6a4e5value-0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77seed", + "source": "dfc20e07-7aef-4fc0-a3a1-7bf68ec6a4e5", + "target": "0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77", + "type": "default", + "sourceHandle": "value", + "targetHandle": "seed" + }, + { + "id": "reactflow__edge-fc9d0e35-a6de-4a19-84e1-c72497c823f6conditioning-2fb1577f-0a56-4f12-8711-8afcaaaf1d5epositive_conditioning", + "source": "fc9d0e35-a6de-4a19-84e1-c72497c823f6", + "target": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "positive_conditioning" + }, + { + "id": "reactflow__edge-c2eaf1ba-5708-4679-9e15-945b8b432692conditioning-2fb1577f-0a56-4f12-8711-8afcaaaf1d5enegative_conditioning", + "source": "c2eaf1ba-5708-4679-9e15-945b8b432692", + "target": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "negative_conditioning" + }, + { + "id": "reactflow__edge-0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77noise-2fb1577f-0a56-4f12-8711-8afcaaaf1d5enoise", + "source": "0eb5f3f5-1b91-49eb-9ef0-41d67c7eae77", + "target": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "type": "default", + "sourceHandle": "noise", + "targetHandle": "noise" + }, + { + "id": "reactflow__edge-d6353b7f-b447-4e17-8f2e-80a88c91d426unet-2fb1577f-0a56-4f12-8711-8afcaaaf1d5eunet", + "source": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "target": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "type": "default", + "sourceHandle": "unet", + "targetHandle": "unet" + }, + { + "id": "reactflow__edge-2fb1577f-0a56-4f12-8711-8afcaaaf1d5elatents-491ec988-3c77-4c37-af8a-39a0c4e7a2a1latents", + "source": "2fb1577f-0a56-4f12-8711-8afcaaaf1d5e", + "target": "491ec988-3c77-4c37-af8a-39a0c4e7a2a1", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-d6353b7f-b447-4e17-8f2e-80a88c91d426vae-491ec988-3c77-4c37-af8a-39a0c4e7a2a1vae", + "source": "d6353b7f-b447-4e17-8f2e-80a88c91d426", + "target": "491ec988-3c77-4c37-af8a-39a0c4e7a2a1", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + } + ] +} \ No newline at end of file From 79cf3ec9a5eb7f39109c5fc00b501953773d073c Mon Sep 17 00:00:00 2001 From: Millun Atluri Date: Wed, 20 Dec 2023 18:53:49 +1100 Subject: [PATCH 02/15] Add facedetailer workflow --- ...er with IP-Adapter & Canny (See Note).json | 2930 +++++++++++++++++ 1 file changed, 2930 insertions(+) create mode 100644 invokeai/app/services/workflow_records/default_workflows/Face Detailer with IP-Adapter & Canny (See Note).json diff --git a/invokeai/app/services/workflow_records/default_workflows/Face Detailer with IP-Adapter & Canny (See Note).json b/invokeai/app/services/workflow_records/default_workflows/Face Detailer with IP-Adapter & Canny (See Note).json new file mode 100644 index 0000000000..6f392d6a7b --- /dev/null +++ b/invokeai/app/services/workflow_records/default_workflows/Face Detailer with IP-Adapter & Canny (See Note).json @@ -0,0 +1,2930 @@ +{ + "id": "972fc0e9-a13f-4658-86b9-aef100d124ba", + "name": "Face Detailer with IP-Adapter & Canny (See Note)", + "author": "kosmoskatten", + "description": "A workflow to add detail to and improve faces. This workflow is most effective when used with a model that creates realistic outputs. For best results, use this image as the blur mask: https://i.imgur.com/Gxi61zP.png", + "version": "1.0.0", + "contact": "invoke@invoke.ai", + "tags": "face detailer, IP-Adapter, Canny", + "notes": "", + "exposedFields": [ + { + "nodeId": "cdfa5ab0-b3e2-43ed-85bb-2ac4aa83bc05", + "fieldName": "value" + }, + { + "nodeId": "64712037-92e8-483f-9f6e-87588539c1b8", + "fieldName": "value" + }, + { + "nodeId": "77da4e4d-5778-4469-8449-ffed03d54bdb", + "fieldName": "radius" + }, + { + "nodeId": "f0de6c44-4515-4f79-bcc0-dee111bcfe31", + "fieldName": "value" + }, + { + "nodeId": "2c9bc2a6-6c03-4861-aad4-db884a7682f8", + "fieldName": "image" + }, + { + "nodeId": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "fieldName": "image" + } + ], + "meta": { + "category": "default", + "version": "2.0.0" + }, + "nodes": [ + { + "id": "44f2c190-eb03-460d-8d11-a94d13b33f19", + "type": "invocation", + "data": { + "id": "44f2c190-eb03-460d-8d11-a94d13b33f19", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "916b229a-38e1-45a2-a433-cca97495b143", + "name": "prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "ae9aeb1a-4ebd-4bc3-b6e6-a8c9adca01f6", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "4d59bad1-99a9-43e2-bdb4-7a0f3dd5b787", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 2575, + "y": -250 + } + }, + { + "id": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "type": "invocation", + "data": { + "id": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "type": "img_resize", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "48ff6f70-380c-4e19-acf7-91063cfff8a8", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "2a348a03-07a3-4a97-93c8-46051045b32f", + "name": "image", + "fieldKind": "input", + "label": "Blur Mask", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "6b95969c-ca73-4b54-815d-7aae305a67bd", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "af83c526-c730-4a34-8f73-80f443fecc05", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "resample_mode": { + "id": "43f7d6b5-ebe0-43c4-bf5d-8fb7fdc40a3f", + "name": "resample_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "lanczos" + } + }, + "outputs": { + "image": { + "id": "e492b013-615d-4dfd-b0d8-7df7b5ba9a9d", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "05f829b3-c253-495a-b1ad-9906c0833e49", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "65d5d662-2527-4f3c-8a87-0a7d9d4486de", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 397, + "position": { + "x": 4675, + "y": 625 + } + }, + { + "id": "2c9bc2a6-6c03-4861-aad4-db884a7682f8", + "type": "invocation", + "data": { + "id": "2c9bc2a6-6c03-4861-aad4-db884a7682f8", + "type": "image", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "729c571b-d5a0-4b53-8f50-5e11eb744f66", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + }, + "value": { + "image_name": "42a524fd-ed77-46e2-b52f-40375633f357.png" + } + } + }, + "outputs": { + "image": { + "id": "3632a144-58d6-4447-bafc-e4f7d6ca96bf", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "30faefcc-81a1-445b-a3fe-0110ceb56772", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "d173d225-849a-4498-a75d-ba17210dbd3e", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 489, + "position": { + "x": 2050, + "y": -75 + } + }, + { + "id": "9ae34718-a17d-401d-9859-086896c29fca", + "type": "invocation", + "data": { + "id": "9ae34718-a17d-401d-9859-086896c29fca", + "type": "face_off", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "0144d549-b04a-49c2-993f-9ecb2695191a", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "9c580dec-a958-43a4-9aa0-7ab9491c56a0", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "face_id": { + "id": "1ee762e1-810f-46f7-a591-ecd28abff85b", + "name": "face_id", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "minimum_confidence": { + "id": "74d2bae8-7ac5-4f8f-afb7-1efc76ed72a0", + "name": "minimum_confidence", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.5 + }, + "x_offset": { + "id": "f1c1489d-cbbb-45d2-ba94-e150fc5ce24d", + "name": "x_offset", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "y_offset": { + "id": "6621377a-7e29-4841-aa47-aa7d438662f9", + "name": "y_offset", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "padding": { + "id": "0414c830-1be8-48cd-b0c8-6de10b099029", + "name": "padding", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 64 + }, + "chunk": { + "id": "22eba30a-c68a-4e5f-8f97-315830959b04", + "name": "chunk", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "7d8fa807-0e9c-4d6a-a85a-388bd0cb5166", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "048361ca-314c-44a4-8b6e-ca4917e3468f", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "7b721071-63e5-4d54-9607-9fa2192163a8", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "mask": { + "id": "a9c6194a-3dbd-4b18-af04-a85a9498f04e", + "name": "mask", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "x": { + "id": "d072582c-2db5-430b-9e50-b50277baa7d5", + "name": "x", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "y": { + "id": "40624813-e55d-42d7-bc14-dea48ccfd9c8", + "name": "y", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 657, + "position": { + "x": 2575, + "y": 200 + } + }, + { + "id": "50a8db6a-3796-4522-8547-53275efa4e7d", + "type": "invocation", + "data": { + "id": "50a8db6a-3796-4522-8547-53275efa4e7d", + "type": "img_resize", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "6bf91925-e22e-4bcb-90e4-f8ac32ddff36", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "65af3f4e-7a89-4df4-8ba9-377af1701d16", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "1f036fee-77f3-480f-b690-089b27616ab8", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "0c703b6e-e91a-4cd7-8b9e-b97865f76793", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "resample_mode": { + "id": "ed77cf71-94cb-4da4-b536-75cb7aad8e54", + "name": "resample_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "lanczos" + } + }, + "outputs": { + "image": { + "id": "0d9e437b-6a08-45e1-9a55-ef03ae28e616", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "7c56c704-b4e5-410f-bb62-cd441ddb454f", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "45e12e17-7f25-46bd-a804-4384ec6b98cc", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 3000, + "y": 0 + } + }, + { + "id": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "type": "invocation", + "data": { + "id": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "type": "i2l", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "6c4d2827-4995-49d4-94ce-0ba0541d8839", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "vae": { + "id": "9d6e3ab6-b6a4-45ac-ad75-0a96efba4c2f", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "9c258141-a75d-4ffd-bce5-f3fb3d90b720", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "2235cc48-53c9-4e8a-a74a-ed41c61f2993", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "latents": { + "id": "8eb9293f-8f43-4c0c-b0fb-8c4db1200f87", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "ce493959-d308-423c-b0f5-db05912e0318", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "827bf290-94fb-455f-a970-f98ba8800eac", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 3100, + "y": -275 + } + }, + { + "id": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "invocation", + "data": { + "id": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "denoise_latents", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.5.0", + "nodePack": "invokeai", + "inputs": { + "positive_conditioning": { + "id": "673e4094-448b-4c59-ab05-d05b29b3e07f", + "name": "positive_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "negative_conditioning": { + "id": "3b3bac27-7e8a-4c4e-8b5b-c5231125302a", + "name": "negative_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "noise": { + "id": "d7c20d11-fbfb-4613-ba58-bf00307e53be", + "name": "noise", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "steps": { + "id": "e4af3bea-dae4-403f-8cec-6cb66fa888ce", + "name": "steps", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 80 + }, + "cfg_scale": { + "id": "9ec125bb-6819-4970-89fe-fe09e6b96885", + "name": "cfg_scale", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 3 + }, + "denoising_start": { + "id": "7190b40d-9467-4238-b180-0d19065258e2", + "name": "denoising_start", + "fieldKind": "input", + "label": "Original Image Percent", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.2 + }, + "denoising_end": { + "id": "c033f2d4-b60a-4a25-8a88-7852b556657a", + "name": "denoising_end", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "scheduler": { + "id": "bb043b8a-a119-4b2a-bb88-8afb364bdcc1", + "name": "scheduler", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "SchedulerField" + }, + "value": "dpmpp_2m_sde_k" + }, + "unet": { + "id": "16d7688a-fc80-405c-aa55-a8ba2a1efecb", + "name": "unet", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "control": { + "id": "d0225ede-7d03-405d-b5b4-97c07d9b602b", + "name": "control", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "ControlField" + } + }, + "ip_adapter": { + "id": "6fbe0a17-6b85-4d3e-835d-0e23d3040bf4", + "name": "ip_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IPAdapterField" + } + }, + "t2i_adapter": { + "id": "2e4e1e6e-0278-47e3-a464-1a51760a9411", + "name": "t2i_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "T2IAdapterField" + } + }, + "cfg_rescale_multiplier": { + "id": "c9703a2e-4178-493c-90b9-81325a83a5ec", + "name": "cfg_rescale_multiplier", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "latents": { + "id": "b2527e78-6f55-4274-aaa0-8fef1c928faa", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "denoise_mask": { + "id": "cceec5a4-d3e9-4cff-a1e1-b5b62cb12588", + "name": "denoise_mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "DenoiseMaskField" + } + } + }, + "outputs": { + "latents": { + "id": "6eca0515-4357-40be-ac8d-f84eb927dc31", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "14453d1c-6202-4377-811c-88ac9c024e77", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "0e0e04dc-4158-4461-b0ba-6c6af16e863c", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 705, + "position": { + "x": 4597.554345564559, + "y": -265.6421598623905 + } + }, + { + "id": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "invocation", + "data": { + "id": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "noise", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.1", + "nodePack": "invokeai", + "inputs": { + "seed": { + "id": "c6b5bc5e-ef09-4f9c-870e-1110a0f5017f", + "name": "seed", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 123451234 + }, + "width": { + "id": "7bdd24b6-4f14-4d0a-b8fc-9b24145b4ba9", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "dc15bf97-b8d5-49c6-999b-798b33679418", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "use_cpu": { + "id": "00626297-19dd-4989-9688-e8d527c9eacf", + "name": "use_cpu", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "noise": { + "id": "2915f8ae-0f6e-4f26-8541-0ebf477586b6", + "name": "noise", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "26587461-a24a-434d-9ae5-8d8f36fea221", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "335d08fc-8bf1-4393-8902-2c579f327b51", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 4025, + "y": -175 + } + }, + { + "id": "2224ed72-2453-4252-bd89-3085240e0b6f", + "type": "invocation", + "data": { + "id": "2224ed72-2453-4252-bd89-3085240e0b6f", + "type": "l2i", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": false, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "2f077d6f-579e-4399-9986-3feabefa9ade", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "latents": { + "id": "568a1537-dc7c-44f5-8a87-3571b0528b85", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "vae": { + "id": "392c3757-ad3a-46af-8d76-9724ca30aad8", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "90f98601-c05d-453e-878b-18e23cc222b4", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "6be5cad7-dd41-4f83-98e7-124a6ad1728d", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "image": { + "id": "6f90a4f5-42dd-472a-8f30-403bcbc16531", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "4d1c8a66-35fc-40e9-a7a9-d8604a247d33", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "e668cfb3-aedc-4032-94c9-b8add1fbaacf", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 267, + "position": { + "x": 4980.1395106966565, + "y": -255.9158921745602 + } + }, + { + "id": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "type": "invocation", + "data": { + "id": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "type": "lscale", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "latents": { + "id": "79e8f073-ddc3-416e-b818-6ef8ec73cc07", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "scale_factor": { + "id": "23f78d24-72df-4bde-8d3c-8593ce507205", + "name": "scale_factor", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1.5 + }, + "mode": { + "id": "4ab30c38-57d3-480d-8b34-918887e92340", + "name": "mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "bilinear" + }, + "antialias": { + "id": "22b39171-0003-44f0-9c04-d241581d2a39", + "name": "antialias", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "latents": { + "id": "f6d71aef-6251-4d51-afa8-f692a72bfd1f", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "8db4cf33-5489-4887-a5f6-5e926d959c40", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "74e1ec7c-50b6-4e97-a7b8-6602e6d78c08", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 3075, + "y": -175 + } + }, + { + "id": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "invocation", + "data": { + "id": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "img_paste", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": false, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "159f5a3c-4b47-46dd-b8fe-450455ee3dcf", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "base_image": { + "id": "445cfacf-5042-49ae-a63e-c19f21f90b1d", + "name": "base_image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "image": { + "id": "c292948b-8efd-4f5c-909d-d902cfd1509a", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "mask": { + "id": "8b7bc7e9-35b5-45bc-9b8c-e15e92ab4d74", + "name": "mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "x": { + "id": "0694ba58-07bc-470b-80b5-9c7a99b64607", + "name": "x", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "y": { + "id": "40f8b20b-f804-4ec2-9622-285726f7665f", + "name": "y", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "crop": { + "id": "8a09a132-c07e-4cfb-8ec2-7093dc063f99", + "name": "crop", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "4a96ec78-d4b6-435f-b5a3-6366cbfcfba7", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "c1ee69c7-6ca0-4604-abc9-b859f4178421", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "6c198681-5f16-4526-8e37-0bf000962acd", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 504, + "position": { + "x": 6000, + "y": -200 + } + }, + { + "id": "ff8c23dc-da7c-45b7-b5c9-d984b12f02ef", + "type": "invocation", + "data": { + "id": "ff8c23dc-da7c-45b7-b5c9-d984b12f02ef", + "type": "img_resize", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "afbbb112-60e4-44c8-bdfd-30f48d58b236", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "2a348a03-07a3-4a97-93c8-46051045b32f", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "6b95969c-ca73-4b54-815d-7aae305a67bd", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "af83c526-c730-4a34-8f73-80f443fecc05", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "resample_mode": { + "id": "43f7d6b5-ebe0-43c4-bf5d-8fb7fdc40a3f", + "name": "resample_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "lanczos" + } + }, + "outputs": { + "image": { + "id": "e492b013-615d-4dfd-b0d8-7df7b5ba9a9d", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "05f829b3-c253-495a-b1ad-9906c0833e49", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "65d5d662-2527-4f3c-8a87-0a7d9d4486de", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 397, + "position": { + "x": 5500, + "y": -225 + } + }, + { + "id": "cdfa5ab0-b3e2-43ed-85bb-2ac4aa83bc05", + "type": "invocation", + "data": { + "id": "cdfa5ab0-b3e2-43ed-85bb-2ac4aa83bc05", + "type": "float", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "value": { + "id": "d5d8063d-44f6-4e20-b557-2f4ce093c7ef", + "name": "value", + "fieldKind": "input", + "label": "Orignal Image Percentage", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.4 + } + }, + "outputs": { + "value": { + "id": "562416a4-0d75-48aa-835e-5e2d221dfbb7", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 4025, + "y": -75 + } + }, + { + "id": "64712037-92e8-483f-9f6e-87588539c1b8", + "type": "invocation", + "data": { + "id": "64712037-92e8-483f-9f6e-87588539c1b8", + "type": "float", + "label": "CFG Main", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "value": { + "id": "750358d5-251d-4fe6-a673-2cde21995da2", + "name": "value", + "fieldKind": "input", + "label": "CFG Main", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 6 + } + }, + "outputs": { + "value": { + "id": "eea7f6d2-92e4-4581-b555-64a44fda2be9", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 4025, + "y": 75 + } + }, + { + "id": "c865f39f-f830-4ed7-88a5-e935cfe050a9", + "type": "invocation", + "data": { + "id": "c865f39f-f830-4ed7-88a5-e935cfe050a9", + "type": "rand_int", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": false, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "low": { + "id": "31e29709-9f19-45b0-a2de-fdee29a50393", + "name": "low", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "high": { + "id": "d47d875c-509d-4fa3-9112-e335d3144a17", + "name": "high", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 2147483647 + } + }, + "outputs": { + "value": { + "id": "15b8d1ea-d2ac-4b3a-9619-57bba9a6da75", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 4025, + "y": -275 + } + }, + { + "id": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "type": "invocation", + "data": { + "id": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "type": "main_model_loader", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "model": { + "id": "54e737f9-2547-4bd9-a607-733d02f0c990", + "name": "model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MainModelField" + }, + "value": { + "model_name": "epicrealism_naturalSinRC1VAE", + "base_model": "sd-1", + "model_type": "main" + } + } + }, + "outputs": { + "unet": { + "id": "3483ea21-f0b3-4422-894b-36c5d7701365", + "name": "unet", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "clip": { + "id": "dddd055f-5c1b-4e61-977b-6393da9006fa", + "name": "clip", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + }, + "vae": { + "id": "879893b4-3415-4879-8dff-aa1727ef5e63", + "name": "vae", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + } + } + }, + "width": 320, + "height": 227, + "position": { + "x": 2050, + "y": -525 + } + }, + { + "id": "f4d15b64-c4a6-42a5-90fc-e4ed07a0ca65", + "type": "invocation", + "data": { + "id": "f4d15b64-c4a6-42a5-90fc-e4ed07a0ca65", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "prompt": { + "id": "916b229a-38e1-45a2-a433-cca97495b143", + "name": "prompt", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "ae9aeb1a-4ebd-4bc3-b6e6-a8c9adca01f6", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "4d59bad1-99a9-43e2-bdb4-7a0f3dd5b787", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 2550, + "y": -525 + } + }, + { + "id": "22b750db-b85e-486b-b278-ac983e329813", + "type": "invocation", + "data": { + "id": "22b750db-b85e-486b-b278-ac983e329813", + "type": "ip_adapter", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.1.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "088a126c-ab1d-4c7a-879a-c1eea09eac8e", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "ip_adapter_model": { + "id": "f2ac529f-f778-4a12-af12-0c7e449de17a", + "name": "ip_adapter_model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IPAdapterModelField" + }, + "value": { + "model_name": "ip_adapter_plus_face_sd15", + "base_model": "sd-1" + } + }, + "weight": { + "id": "ddb4a7cb-607d-47e8-b46b-cc1be27ebde0", + "name": "weight", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.5 + }, + "begin_step_percent": { + "id": "1807371f-b56c-4777-baa2-de71e21f0b80", + "name": "begin_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "end_step_percent": { + "id": "4ea8e4dc-9cd7-445e-9b32-8934c652381b", + "name": "end_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.8 + } + }, + "outputs": { + "ip_adapter": { + "id": "739b5fed-d813-4611-8f87-1dded25a7619", + "name": "ip_adapter", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IPAdapterField" + } + } + } + }, + "width": 320, + "height": 396, + "position": { + "x": 3575, + "y": -200 + } + }, + { + "id": "f60b6161-8f26-42f6-89ff-545e6011e501", + "type": "invocation", + "data": { + "id": "f60b6161-8f26-42f6-89ff-545e6011e501", + "type": "controlnet", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.1.0", + "nodePack": "invokeai", + "inputs": { + "image": { + "id": "96434c75-abd8-4b73-ab82-0b358e4735bf", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "control_model": { + "id": "21551ac2-ee50-4fe8-b06c-5be00680fb5c", + "name": "control_model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlNetModelField" + }, + "value": { + "model_name": "canny", + "base_model": "sd-1" + } + }, + "control_weight": { + "id": "1dacac0a-b985-4bdf-b4b5-b960f4cff6ed", + "name": "control_weight", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 0.5 + }, + "begin_step_percent": { + "id": "b2a3f128-7fc1-4c12-acc8-540f013c856b", + "name": "begin_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "end_step_percent": { + "id": "0e701834-f7ba-4a6e-b9cb-6d4aff5dacd8", + "name": "end_step_percent", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.5 + }, + "control_mode": { + "id": "f9a5f038-ae80-4b6e-8a48-362a2c858299", + "name": "control_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "balanced" + }, + "resize_mode": { + "id": "5369dd44-a708-4b66-8182-fea814d2a0ae", + "name": "resize_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "just_resize" + } + }, + "outputs": { + "control": { + "id": "f470a1af-7b68-4849-a144-02bc345fd810", + "name": "control", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ControlField" + } + } + } + }, + "width": 320, + "height": 511, + "position": { + "x": 3950, + "y": 150 + } + }, + { + "id": "8fe598c6-d447-44fa-a165-4975af77d080", + "type": "invocation", + "data": { + "id": "8fe598c6-d447-44fa-a165-4975af77d080", + "type": "canny_image_processor", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "855f4575-309a-4810-bd02-7c4a04e0efc8", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "7d2695fa-a617-431a-bc0e-69ac7c061651", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "low_threshold": { + "id": "ceb37a49-c989-4afa-abbf-49b6e52ef663", + "name": "low_threshold", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 100 + }, + "high_threshold": { + "id": "6ec118f8-ca6c-4be7-9951-6eee58afbc1b", + "name": "high_threshold", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 200 + } + }, + "outputs": { + "image": { + "id": "264bcaaf-d185-43ce-9e1a-b6f707140c0c", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "0d374d8e-d5c7-49be-9057-443e32e45048", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "fa892b68-6135-4598-a765-e79cd5c6e3f6", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 3519.4131037388597, + "y": 576.7946795840575 + } + }, + { + "id": "4bd4ae80-567f-4366-b8c6-3bb06f4fb46a", + "type": "invocation", + "data": { + "id": "4bd4ae80-567f-4366-b8c6-3bb06f4fb46a", + "type": "img_scale", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "46fc750e-7dda-4145-8f72-be88fb93f351", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "f7f41bb3-9a5a-4022-b671-0acc2819f7c3", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "scale_factor": { + "id": "1ae95574-f725-4cbc-bb78-4c9db240f78a", + "name": "scale_factor", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1.5 + }, + "resample_mode": { + "id": "0756e37d-3d01-4c2c-9364-58e8978b04a2", + "name": "resample_mode", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "bicubic" + } + }, + "outputs": { + "image": { + "id": "2729e697-cacc-4874-94bf-3aee5c18b5f9", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "d9551981-cbd3-419a-bcb9-5b50600e8c18", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "3355c99e-cdc6-473b-a7c6-a9d1dcc941e5", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 3079.916484101321, + "y": 151.0148192064986 + } + }, + { + "id": "381d5b6a-f044-48b0-bc07-6138fbfa8dfc", + "type": "invocation", + "data": { + "id": "381d5b6a-f044-48b0-bc07-6138fbfa8dfc", + "type": "mask_combine", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "061ea794-2494-429e-bfdd-5fbd2c7eeb99", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "mask1": { + "id": "446c6c99-9cb5-4035-a452-ab586ef4ede9", + "name": "mask1", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "mask2": { + "id": "ebbe37b8-8bf3-4520-b6f5-631fe2d05d66", + "name": "mask2", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + } + }, + "outputs": { + "image": { + "id": "7c33cfae-ea9a-4572-91ca-40fc4112369f", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "7410c10c-3060-44a9-b399-43555c3e1156", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "3eb74c96-ae3e-4091-b027-703428244fdf", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 283, + "position": { + "x": 5450, + "y": 250 + } + }, + { + "id": "77da4e4d-5778-4469-8449-ffed03d54bdb", + "type": "invocation", + "data": { + "id": "77da4e4d-5778-4469-8449-ffed03d54bdb", + "type": "img_blur", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "nodePack": "invokeai", + "inputs": { + "metadata": { + "id": "755d4fa2-a520-4837-a3da-65e1f479e6e6", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "a4786d7d-9593-4f5f-830b-d94bb0e42bca", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "radius": { + "id": "e1c9afa0-4d41-4664-b560-e1e85f467267", + "name": "radius", + "fieldKind": "input", + "label": "Mask Blue", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 150 + }, + "blur_type": { + "id": "f6231886-0981-444b-bd26-24674f87e7cb", + "name": "blur_type", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "EnumField" + }, + "value": "gaussian" + } + }, + "outputs": { + "image": { + "id": "20c7bcfc-269d-4119-8b45-6c59dd4005d7", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "37e228ef-cb59-4477-b18f-343609d7bb4e", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "2de6080e-8bc3-42cd-bb8a-afd72f082df4", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 340, + "position": { + "x": 5000, + "y": 300 + } + }, + { + "id": "f0de6c44-4515-4f79-bcc0-dee111bcfe31", + "type": "invocation", + "data": { + "id": "f0de6c44-4515-4f79-bcc0-dee111bcfe31", + "type": "float", + "label": "Face Detail Scale", + "isOpen": false, + "notes": "The image is cropped to the face and scaled to 512x512. This value can scale even more. Best result with value between 1-2.\n\n1 = 512\n2 = 1024\n\n", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "nodePack": "invokeai", + "inputs": { + "value": { + "id": "9b51a26f-af3c-4caa-940a-5183234b1ed7", + "name": "value", + "fieldKind": "input", + "label": "Face Detail Scale", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1.5 + } + }, + "outputs": { + "value": { + "id": "c7c87b77-c149-4e9c-8ed1-beb1ba013055", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 2550, + "y": 125 + } + }, + { + "id": "a6482723-4e0a-4e40-98c0-b20622bf5f16", + "type": "invocation", + "data": { + "id": "a6482723-4e0a-4e40-98c0-b20622bf5f16", + "type": "face_mask_detection", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.2.0", + "inputs": { + "metadata": { + "id": "44e1fca6-3f06-4698-9562-6743c1f7a739", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "image": { + "id": "65ba4653-8c35-403d-838b-ddac075e4118", + "name": "image", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "face_ids": { + "id": "630e86e5-3041-47c4-8864-b8ee71ec7da5", + "name": "face_ids", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "minimum_confidence": { + "id": "8c4aef57-90c6-4904-9113-7189db1357c9", + "name": "minimum_confidence", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.5 + }, + "x_offset": { + "id": "2d409495-4aee-41e2-9688-f37fb6add537", + "name": "x_offset", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "y_offset": { + "id": "de3c1e68-6962-4520-b672-989afff1d2a1", + "name": "y_offset", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "chunk": { + "id": "9a11971a-0759-4782-902a-8300070d8861", + "name": "chunk", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "invert_mask": { + "id": "2abecba7-35d0-4cc4-9732-769e97d34c75", + "name": "invert_mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "af33585c-5451-4738-b1da-7ff83afdfbf8", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "52cec0bd-d2e5-4514-8ebf-1c0d8bd1b81d", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "05edbbc8-99df-42e0-9b9b-de7b555e44cc", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "mask": { + "id": "cf928567-3e05-42dd-9591-0d3d942034f8", + "name": "mask", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + } + } + }, + "width": 320, + "height": 585, + "position": { + "x": 4300, + "y": 600 + } + } + ], + "edges": [ + { + "id": "50a8db6a-3796-4522-8547-53275efa4e7d-de8b1a48-a2e4-42ca-90bb-66058bffd534-collapsed", + "source": "50a8db6a-3796-4522-8547-53275efa4e7d", + "target": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "type": "collapsed" + }, + { + "id": "f0de6c44-4515-4f79-bcc0-dee111bcfe31-2974e5b3-3d41-4b6f-9953-cd21e8f3a323-collapsed", + "source": "f0de6c44-4515-4f79-bcc0-dee111bcfe31", + "target": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "type": "collapsed" + }, + { + "id": "de8b1a48-a2e4-42ca-90bb-66058bffd534-2974e5b3-3d41-4b6f-9953-cd21e8f3a323-collapsed", + "source": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "target": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "type": "collapsed" + }, + { + "id": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323-35623411-ba3a-4eaa-91fd-1e0fda0a5b42-collapsed", + "source": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "target": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "collapsed" + }, + { + "id": "c865f39f-f830-4ed7-88a5-e935cfe050a9-35623411-ba3a-4eaa-91fd-1e0fda0a5b42-collapsed", + "source": "c865f39f-f830-4ed7-88a5-e935cfe050a9", + "target": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "collapsed" + }, + { + "id": "reactflow__edge-2c9bc2a6-6c03-4861-aad4-db884a7682f8image-9ae34718-a17d-401d-9859-086896c29fcaimage", + "source": "2c9bc2a6-6c03-4861-aad4-db884a7682f8", + "target": "9ae34718-a17d-401d-9859-086896c29fca", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcaimage-50a8db6a-3796-4522-8547-53275efa4e7dimage", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "50a8db6a-3796-4522-8547-53275efa4e7d", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-35623411-ba3a-4eaa-91fd-1e0fda0a5b42noise-bd06261d-a74a-4d1f-8374-745ed6194bc2noise", + "source": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "noise", + "targetHandle": "noise" + }, + { + "id": "reactflow__edge-de8b1a48-a2e4-42ca-90bb-66058bffd534latents-2974e5b3-3d41-4b6f-9953-cd21e8f3a323latents", + "source": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "target": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-2974e5b3-3d41-4b6f-9953-cd21e8f3a323latents-bd06261d-a74a-4d1f-8374-745ed6194bc2latents", + "source": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-2974e5b3-3d41-4b6f-9953-cd21e8f3a323width-35623411-ba3a-4eaa-91fd-1e0fda0a5b42width", + "source": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "target": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "default", + "sourceHandle": "width", + "targetHandle": "width" + }, + { + "id": "reactflow__edge-2974e5b3-3d41-4b6f-9953-cd21e8f3a323height-35623411-ba3a-4eaa-91fd-1e0fda0a5b42height", + "source": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "target": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "default", + "sourceHandle": "height", + "targetHandle": "height" + }, + { + "id": "reactflow__edge-2c9bc2a6-6c03-4861-aad4-db884a7682f8image-a7d14545-aa09-4b96-bfc5-40c009af9110base_image", + "source": "2c9bc2a6-6c03-4861-aad4-db884a7682f8", + "target": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "default", + "sourceHandle": "image", + "targetHandle": "base_image" + }, + { + "id": "reactflow__edge-2224ed72-2453-4252-bd89-3085240e0b6fimage-ff8c23dc-da7c-45b7-b5c9-d984b12f02efimage", + "source": "2224ed72-2453-4252-bd89-3085240e0b6f", + "target": "ff8c23dc-da7c-45b7-b5c9-d984b12f02ef", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcawidth-ff8c23dc-da7c-45b7-b5c9-d984b12f02efwidth", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "ff8c23dc-da7c-45b7-b5c9-d984b12f02ef", + "type": "default", + "sourceHandle": "width", + "targetHandle": "width" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcaheight-ff8c23dc-da7c-45b7-b5c9-d984b12f02efheight", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "ff8c23dc-da7c-45b7-b5c9-d984b12f02ef", + "type": "default", + "sourceHandle": "height", + "targetHandle": "height" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcax-a7d14545-aa09-4b96-bfc5-40c009af9110x", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "default", + "sourceHandle": "x", + "targetHandle": "x" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcay-a7d14545-aa09-4b96-bfc5-40c009af9110y", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "default", + "sourceHandle": "y", + "targetHandle": "y" + }, + { + "id": "reactflow__edge-50a8db6a-3796-4522-8547-53275efa4e7dimage-de8b1a48-a2e4-42ca-90bb-66058bffd534image", + "source": "50a8db6a-3796-4522-8547-53275efa4e7d", + "target": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-cdfa5ab0-b3e2-43ed-85bb-2ac4aa83bc05value-bd06261d-a74a-4d1f-8374-745ed6194bc2denoising_start", + "source": "cdfa5ab0-b3e2-43ed-85bb-2ac4aa83bc05", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "value", + "targetHandle": "denoising_start" + }, + { + "id": "reactflow__edge-64712037-92e8-483f-9f6e-87588539c1b8value-bd06261d-a74a-4d1f-8374-745ed6194bc2cfg_scale", + "source": "64712037-92e8-483f-9f6e-87588539c1b8", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "value", + "targetHandle": "cfg_scale" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcawidth-c59e815c-1f3a-4e2b-b6b8-66f4b005e955width", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "type": "default", + "sourceHandle": "width", + "targetHandle": "width" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcaheight-c59e815c-1f3a-4e2b-b6b8-66f4b005e955height", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "type": "default", + "sourceHandle": "height", + "targetHandle": "height" + }, + { + "id": "reactflow__edge-ff8c23dc-da7c-45b7-b5c9-d984b12f02efimage-a7d14545-aa09-4b96-bfc5-40c009af9110image", + "source": "ff8c23dc-da7c-45b7-b5c9-d984b12f02ef", + "target": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-bd06261d-a74a-4d1f-8374-745ed6194bc2latents-2224ed72-2453-4252-bd89-3085240e0b6flatents", + "source": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "target": "2224ed72-2453-4252-bd89-3085240e0b6f", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-c865f39f-f830-4ed7-88a5-e935cfe050a9value-35623411-ba3a-4eaa-91fd-1e0fda0a5b42seed", + "source": "c865f39f-f830-4ed7-88a5-e935cfe050a9", + "target": "35623411-ba3a-4eaa-91fd-1e0fda0a5b42", + "type": "default", + "sourceHandle": "value", + "targetHandle": "seed" + }, + { + "id": "reactflow__edge-76ea1e31-eabe-4080-935e-e74ce20e2805clip-f4d15b64-c4a6-42a5-90fc-e4ed07a0ca65clip", + "source": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "target": "f4d15b64-c4a6-42a5-90fc-e4ed07a0ca65", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-76ea1e31-eabe-4080-935e-e74ce20e2805vae-de8b1a48-a2e4-42ca-90bb-66058bffd534vae", + "source": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "target": "de8b1a48-a2e4-42ca-90bb-66058bffd534", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + }, + { + "id": "reactflow__edge-f4d15b64-c4a6-42a5-90fc-e4ed07a0ca65conditioning-bd06261d-a74a-4d1f-8374-745ed6194bc2positive_conditioning", + "source": "f4d15b64-c4a6-42a5-90fc-e4ed07a0ca65", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "positive_conditioning" + }, + { + "id": "reactflow__edge-44f2c190-eb03-460d-8d11-a94d13b33f19conditioning-bd06261d-a74a-4d1f-8374-745ed6194bc2negative_conditioning", + "source": "44f2c190-eb03-460d-8d11-a94d13b33f19", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "negative_conditioning" + }, + { + "id": "reactflow__edge-76ea1e31-eabe-4080-935e-e74ce20e2805unet-bd06261d-a74a-4d1f-8374-745ed6194bc2unet", + "source": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "unet", + "targetHandle": "unet" + }, + { + "id": "reactflow__edge-76ea1e31-eabe-4080-935e-e74ce20e2805vae-2224ed72-2453-4252-bd89-3085240e0b6fvae", + "source": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "target": "2224ed72-2453-4252-bd89-3085240e0b6f", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + }, + { + "id": "reactflow__edge-76ea1e31-eabe-4080-935e-e74ce20e2805clip-44f2c190-eb03-460d-8d11-a94d13b33f19clip", + "source": "76ea1e31-eabe-4080-935e-e74ce20e2805", + "target": "44f2c190-eb03-460d-8d11-a94d13b33f19", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-22b750db-b85e-486b-b278-ac983e329813ip_adapter-bd06261d-a74a-4d1f-8374-745ed6194bc2ip_adapter", + "source": "22b750db-b85e-486b-b278-ac983e329813", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "ip_adapter", + "targetHandle": "ip_adapter" + }, + { + "id": "reactflow__edge-50a8db6a-3796-4522-8547-53275efa4e7dimage-4bd4ae80-567f-4366-b8c6-3bb06f4fb46aimage", + "source": "50a8db6a-3796-4522-8547-53275efa4e7d", + "target": "4bd4ae80-567f-4366-b8c6-3bb06f4fb46a", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-4bd4ae80-567f-4366-b8c6-3bb06f4fb46aimage-22b750db-b85e-486b-b278-ac983e329813image", + "source": "4bd4ae80-567f-4366-b8c6-3bb06f4fb46a", + "target": "22b750db-b85e-486b-b278-ac983e329813", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-8fe598c6-d447-44fa-a165-4975af77d080image-f60b6161-8f26-42f6-89ff-545e6011e501image", + "source": "8fe598c6-d447-44fa-a165-4975af77d080", + "target": "f60b6161-8f26-42f6-89ff-545e6011e501", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-4bd4ae80-567f-4366-b8c6-3bb06f4fb46aimage-8fe598c6-d447-44fa-a165-4975af77d080image", + "source": "4bd4ae80-567f-4366-b8c6-3bb06f4fb46a", + "target": "8fe598c6-d447-44fa-a165-4975af77d080", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-f60b6161-8f26-42f6-89ff-545e6011e501control-bd06261d-a74a-4d1f-8374-745ed6194bc2control", + "source": "f60b6161-8f26-42f6-89ff-545e6011e501", + "target": "bd06261d-a74a-4d1f-8374-745ed6194bc2", + "type": "default", + "sourceHandle": "control", + "targetHandle": "control" + }, + { + "id": "reactflow__edge-c59e815c-1f3a-4e2b-b6b8-66f4b005e955image-381d5b6a-f044-48b0-bc07-6138fbfa8dfcmask2", + "source": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "target": "381d5b6a-f044-48b0-bc07-6138fbfa8dfc", + "type": "default", + "sourceHandle": "image", + "targetHandle": "mask2" + }, + { + "id": "reactflow__edge-381d5b6a-f044-48b0-bc07-6138fbfa8dfcimage-a7d14545-aa09-4b96-bfc5-40c009af9110mask", + "source": "381d5b6a-f044-48b0-bc07-6138fbfa8dfc", + "target": "a7d14545-aa09-4b96-bfc5-40c009af9110", + "type": "default", + "sourceHandle": "image", + "targetHandle": "mask" + }, + { + "id": "reactflow__edge-77da4e4d-5778-4469-8449-ffed03d54bdbimage-381d5b6a-f044-48b0-bc07-6138fbfa8dfcmask1", + "source": "77da4e4d-5778-4469-8449-ffed03d54bdb", + "target": "381d5b6a-f044-48b0-bc07-6138fbfa8dfc", + "type": "default", + "sourceHandle": "image", + "targetHandle": "mask1" + }, + { + "id": "reactflow__edge-9ae34718-a17d-401d-9859-086896c29fcamask-77da4e4d-5778-4469-8449-ffed03d54bdbimage", + "source": "9ae34718-a17d-401d-9859-086896c29fca", + "target": "77da4e4d-5778-4469-8449-ffed03d54bdb", + "type": "default", + "sourceHandle": "mask", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-f0de6c44-4515-4f79-bcc0-dee111bcfe31value-2974e5b3-3d41-4b6f-9953-cd21e8f3a323scale_factor", + "source": "f0de6c44-4515-4f79-bcc0-dee111bcfe31", + "target": "2974e5b3-3d41-4b6f-9953-cd21e8f3a323", + "type": "default", + "sourceHandle": "value", + "targetHandle": "scale_factor" + }, + { + "id": "reactflow__edge-f0de6c44-4515-4f79-bcc0-dee111bcfe31value-4bd4ae80-567f-4366-b8c6-3bb06f4fb46ascale_factor", + "source": "f0de6c44-4515-4f79-bcc0-dee111bcfe31", + "target": "4bd4ae80-567f-4366-b8c6-3bb06f4fb46a", + "type": "default", + "sourceHandle": "value", + "targetHandle": "scale_factor" + }, + { + "id": "reactflow__edge-2c9bc2a6-6c03-4861-aad4-db884a7682f8image-a6482723-4e0a-4e40-98c0-b20622bf5f16image", + "source": "2c9bc2a6-6c03-4861-aad4-db884a7682f8", + "target": "a6482723-4e0a-4e40-98c0-b20622bf5f16", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + }, + { + "id": "reactflow__edge-a6482723-4e0a-4e40-98c0-b20622bf5f16image-c59e815c-1f3a-4e2b-b6b8-66f4b005e955image", + "source": "a6482723-4e0a-4e40-98c0-b20622bf5f16", + "target": "c59e815c-1f3a-4e2b-b6b8-66f4b005e955", + "type": "default", + "sourceHandle": "image", + "targetHandle": "image" + } + ] +} \ No newline at end of file From 562fb1f3a150a7683290046aaac3c8b5ca23754f Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Wed, 20 Dec 2023 14:47:44 -0500 Subject: [PATCH 03/15] add authToastMiddleware back and fix parsing --- invokeai/frontend/web/src/app/store/store.ts | 2 ++ .../web/src/services/api/authToastMiddleware.ts | 16 +++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/store.ts b/invokeai/frontend/web/src/app/store/store.ts index 5651641afd..6b31f6f8d4 100644 --- a/invokeai/frontend/web/src/app/store/store.ts +++ b/invokeai/frontend/web/src/app/store/store.ts @@ -34,6 +34,7 @@ import { actionSanitizer } from './middleware/devtools/actionSanitizer'; import { actionsDenylist } from './middleware/devtools/actionsDenylist'; import { stateSanitizer } from './middleware/devtools/stateSanitizer'; import { listenerMiddleware } from './middleware/listenerMiddleware'; +import { authToastMiddleware } from 'services/api/authToastMiddleware'; const allReducers = { canvas: canvasReducer, @@ -96,6 +97,7 @@ export const createStore = (uniqueStoreKey?: string, persist = true) => }) .concat(api.middleware) .concat(dynamicMiddlewares) + .concat(authToastMiddleware) .prepend(listenerMiddleware.middleware), enhancers: (getDefaultEnhancers) => { const _enhancers = getDefaultEnhancers().concat(autoBatchEnhancer()); diff --git a/invokeai/frontend/web/src/services/api/authToastMiddleware.ts b/invokeai/frontend/web/src/services/api/authToastMiddleware.ts index 59db2d0b89..a9cf775383 100644 --- a/invokeai/frontend/web/src/services/api/authToastMiddleware.ts +++ b/invokeai/frontend/web/src/services/api/authToastMiddleware.ts @@ -5,12 +5,10 @@ import { t } from 'i18next'; import { z } from 'zod'; const zRejectedForbiddenAction = z.object({ - action: z.object({ - payload: z.object({ - status: z.literal(403), - data: z.object({ - detail: z.string(), - }), + payload: z.object({ + status: z.literal(403), + data: z.object({ + detail: z.string(), }), }), }); @@ -22,8 +20,8 @@ export const authToastMiddleware: Middleware = const parsed = zRejectedForbiddenAction.parse(action); const { dispatch } = api; const customMessage = - parsed.action.payload.data.detail !== 'Forbidden' - ? parsed.action.payload.data.detail + parsed.payload.data.detail !== 'Forbidden' + ? parsed.payload.data.detail : undefined; dispatch( addToast({ @@ -32,7 +30,7 @@ export const authToastMiddleware: Middleware = description: customMessage, }) ); - } catch { + } catch (error) { // no-op } } From 8dd55cc45ed225e628c2d623fe4e116d59454add Mon Sep 17 00:00:00 2001 From: Millun Atluri Date: Thu, 21 Dec 2023 09:54:12 +1100 Subject: [PATCH 04/15] t2i with LoRA --- .../Text to Image with LoRA.json | 903 ++++++++++++++++++ 1 file changed, 903 insertions(+) create mode 100644 invokeai/app/services/workflow_records/default_workflows/Text to Image with LoRA.json diff --git a/invokeai/app/services/workflow_records/default_workflows/Text to Image with LoRA.json b/invokeai/app/services/workflow_records/default_workflows/Text to Image with LoRA.json new file mode 100644 index 0000000000..5dd29d78cf --- /dev/null +++ b/invokeai/app/services/workflow_records/default_workflows/Text to Image with LoRA.json @@ -0,0 +1,903 @@ +{ + "name": "Text to Image with LoRA", + "author": "InvokeAI", + "description": "Simple text to image workflow with a LoRA", + "version": "1.0.0", + "contact": "invoke@invoke.ai", + "tags": "text to image, lora, default", + "notes": "", + "exposedFields": [ + { + "nodeId": "24e9d7ed-4836-4ec4-8f9e-e747721f9818", + "fieldName": "model" + }, + { + "nodeId": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "fieldName": "lora" + }, + { + "nodeId": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "fieldName": "weight" + }, + { + "nodeId": "c3fa6872-2599-4a82-a596-b3446a66cf8b", + "fieldName": "prompt" + } + ], + "meta": { + "version": "2.0.0", + "category": "default" + }, + "id": "a9d70c39-4cdd-4176-9942-8ff3fe32d3b1", + "nodes": [ + { + "id": "85b77bb2-c67a-416a-b3e8-291abe746c44", + "type": "invocation", + "data": { + "id": "85b77bb2-c67a-416a-b3e8-291abe746c44", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "inputs": { + "prompt": { + "id": "39fe92c4-38eb-4cc7-bf5e-cbcd31847b11", + "name": "prompt", + "fieldKind": "input", + "label": "Negative Prompt", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "" + }, + "clip": { + "id": "14313164-e5c4-4e40-a599-41b614fe3690", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "02140b9d-50f3-470b-a0b7-01fc6ed2dcd6", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 3425, + "y": -300 + } + }, + { + "id": "24e9d7ed-4836-4ec4-8f9e-e747721f9818", + "type": "invocation", + "data": { + "id": "24e9d7ed-4836-4ec4-8f9e-e747721f9818", + "type": "main_model_loader", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "inputs": { + "model": { + "id": "e2e1c177-ae39-4244-920e-d621fa156a24", + "name": "model", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MainModelField" + }, + "value": { + "model_name": "Analog-Diffusion", + "base_model": "sd-1", + "model_type": "main" + } + } + }, + "outputs": { + "vae": { + "id": "f91410e8-9378-4298-b285-f0f40ffd9825", + "name": "vae", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "clip": { + "id": "928d91bf-de0c-44a8-b0c8-4de0e2e5b438", + "name": "clip", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + }, + "unet": { + "id": "eacaf530-4e7e-472e-b904-462192189fc1", + "name": "unet", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + } + } + }, + "width": 320, + "height": 227, + "position": { + "x": 2500, + "y": -600 + } + }, + { + "id": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "type": "invocation", + "data": { + "id": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "type": "lora_loader", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "inputs": { + "lora": { + "id": "36d867e8-92ea-4c3f-9ad5-ba05c64cf326", + "name": "lora", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LoRAModelField" + }, + "value": { + "model_name": "Ink scenery", + "base_model": "sd-1" + } + }, + "weight": { + "id": "8be86540-ba81-49b3-b394-2b18fa70b867", + "name": "weight", + "fieldKind": "input", + "label": "LoRA Weight", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0.75 + }, + "unet": { + "id": "9c4d5668-e9e1-411b-8f4b-e71115bc4a01", + "name": "unet", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "clip": { + "id": "918ec00e-e76f-4ad0-aee1-3927298cf03b", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "unet": { + "id": "c63f7825-1bcf-451d-b7a7-aa79f5c77416", + "name": "unet", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "clip": { + "id": "6f79ef2d-00f7-4917-bee3-53e845bf4192", + "name": "clip", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + } + }, + "width": 320, + "height": 252, + "position": { + "x": 2975, + "y": -600 + } + }, + { + "id": "c3fa6872-2599-4a82-a596-b3446a66cf8b", + "type": "invocation", + "data": { + "id": "c3fa6872-2599-4a82-a596-b3446a66cf8b", + "type": "compel", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.0", + "inputs": { + "prompt": { + "id": "39fe92c4-38eb-4cc7-bf5e-cbcd31847b11", + "name": "prompt", + "fieldKind": "input", + "label": "Positive Prompt", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "StringField" + }, + "value": "cute tiger cub" + }, + "clip": { + "id": "14313164-e5c4-4e40-a599-41b614fe3690", + "name": "clip", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ClipField" + } + } + }, + "outputs": { + "conditioning": { + "id": "02140b9d-50f3-470b-a0b7-01fc6ed2dcd6", + "name": "conditioning", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + } + } + }, + "width": 320, + "height": 256, + "position": { + "x": 3425, + "y": -575 + } + }, + { + "id": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "type": "invocation", + "data": { + "id": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "type": "denoise_latents", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.5.0", + "inputs": { + "positive_conditioning": { + "id": "025ff44b-c4c6-4339-91b4-5f461e2cadc5", + "name": "positive_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "negative_conditioning": { + "id": "2d92b45a-a7fb-4541-9a47-7c7495f50f54", + "name": "negative_conditioning", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ConditioningField" + } + }, + "noise": { + "id": "4d0deeff-24ed-4562-a1ca-7833c0649377", + "name": "noise", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "steps": { + "id": "c9907328-aece-4af9-8a95-211b4f99a325", + "name": "steps", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 10 + }, + "cfg_scale": { + "id": "7cf0f031-2078-49f4-9273-bb3a64ad7130", + "name": "cfg_scale", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "FloatField" + }, + "value": 7.5 + }, + "denoising_start": { + "id": "44cec3ba-b404-4b51-ba98-add9d783279e", + "name": "denoising_start", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "denoising_end": { + "id": "3e7975f3-e438-4a13-8a14-395eba1fb7cd", + "name": "denoising_end", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 1 + }, + "scheduler": { + "id": "a6f6509b-7bb4-477d-b5fb-74baefa38111", + "name": "scheduler", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "SchedulerField" + }, + "value": "euler" + }, + "unet": { + "id": "5a87617a-b09f-417b-9b75-0cea4c255227", + "name": "unet", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "UNetField" + } + }, + "control": { + "id": "db87aace-ace8-4f2a-8f2b-1f752389fa9b", + "name": "control", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "ControlField" + } + }, + "ip_adapter": { + "id": "f0c133ed-4d6d-4567-bb9a-b1779810993c", + "name": "ip_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "IPAdapterField" + } + }, + "t2i_adapter": { + "id": "59ee1233-887f-45e7-aa14-cbad5f6cb77f", + "name": "t2i_adapter", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": true, + "name": "T2IAdapterField" + } + }, + "cfg_rescale_multiplier": { + "id": "1a12e781-4b30-4707-b432-18c31866b5c3", + "name": "cfg_rescale_multiplier", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "FloatField" + }, + "value": 0 + }, + "latents": { + "id": "d0e593ae-305c-424b-9acd-3af830085832", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "denoise_mask": { + "id": "b81b5a79-fc2b-4011-aae6-64c92bae59a7", + "name": "denoise_mask", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "DenoiseMaskField" + } + } + }, + "outputs": { + "latents": { + "id": "9ae4022a-548e-407e-90cf-cc5ca5ff8a21", + "name": "latents", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "730ba4bd-2c52-46bb-8c87-9b3aec155576", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "52b98f0b-b5ff-41b5-acc7-d0b1d1011a6f", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 705, + "position": { + "x": 3975, + "y": -575 + } + }, + { + "id": "ea18915f-2c5b-4569-b725-8e9e9122e8d3", + "type": "invocation", + "data": { + "id": "ea18915f-2c5b-4569-b725-8e9e9122e8d3", + "type": "noise", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": true, + "version": "1.0.1", + "inputs": { + "seed": { + "id": "446ac80c-ba0a-4fea-a2d7-21128f52e5bf", + "name": "seed", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "width": { + "id": "779831b3-20b4-4f5f-9de7-d17de57288d8", + "name": "width", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "height": { + "id": "08959766-6d67-4276-b122-e54b911f2316", + "name": "height", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 512 + }, + "use_cpu": { + "id": "53b36a98-00c4-4dc5-97a4-ef3432c0a805", + "name": "use_cpu", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": true + } + }, + "outputs": { + "noise": { + "id": "eed95824-580b-442f-aa35-c073733cecce", + "name": "noise", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "width": { + "id": "7985a261-dfee-47a8-908a-c5a8754f5dc4", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "3d00f6c1-84b0-4262-83d9-3bf755babeea", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 3425, + "y": 75 + } + }, + { + "id": "6fd74a17-6065-47a5-b48b-f4e2b8fa7953", + "type": "invocation", + "data": { + "id": "6fd74a17-6065-47a5-b48b-f4e2b8fa7953", + "type": "rand_int", + "label": "", + "isOpen": false, + "notes": "", + "isIntermediate": true, + "useCache": false, + "version": "1.0.0", + "inputs": { + "low": { + "id": "d25305f3-bfd6-446c-8e2c-0b025ec9e9ad", + "name": "low", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 0 + }, + "high": { + "id": "10376a3d-b8fe-4a51-b81a-ea46d8c12c78", + "name": "high", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + }, + "value": 2147483647 + } + }, + "outputs": { + "value": { + "id": "c64878fa-53b1-4202-b88a-cfb854216a57", + "name": "value", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 32, + "position": { + "x": 3425, + "y": 0 + } + }, + { + "id": "a9683c0a-6b1f-4a5e-8187-c57e764b3400", + "type": "invocation", + "data": { + "id": "a9683c0a-6b1f-4a5e-8187-c57e764b3400", + "type": "l2i", + "label": "", + "isOpen": true, + "notes": "", + "isIntermediate": false, + "useCache": true, + "version": "1.2.0", + "inputs": { + "metadata": { + "id": "b1982e8a-14ad-4029-a697-beb30af8340f", + "name": "metadata", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "MetadataField" + } + }, + "latents": { + "id": "f7669388-9f91-46cc-94fc-301fa7041c3e", + "name": "latents", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "LatentsField" + } + }, + "vae": { + "id": "c6f2d4db-4d0a-4e3d-acb4-b5c5a228a3e2", + "name": "vae", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "VaeField" + } + }, + "tiled": { + "id": "19ef7d31-d96f-4e94-b7e5-95914e9076fc", + "name": "tiled", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + }, + "fp32": { + "id": "a9454533-8ab7-4225-b411-646dc5e76d00", + "name": "fp32", + "fieldKind": "input", + "label": "", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "BooleanField" + }, + "value": false + } + }, + "outputs": { + "image": { + "id": "4f81274e-e216-47f3-9fb6-f97493a40e6f", + "name": "image", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "ImageField" + } + }, + "width": { + "id": "61a9acfb-1547-4f1e-8214-e89bd3855ee5", + "name": "width", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + }, + "height": { + "id": "b15cc793-4172-4b07-bcf4-5627bbc7d0d7", + "name": "height", + "fieldKind": "output", + "type": { + "isCollection": false, + "isCollectionOrScalar": false, + "name": "IntegerField" + } + } + } + }, + "width": 320, + "height": 267, + "position": { + "x": 4450, + "y": -550 + } + } + ], + "edges": [ + { + "id": "6fd74a17-6065-47a5-b48b-f4e2b8fa7953-ea18915f-2c5b-4569-b725-8e9e9122e8d3-collapsed", + "source": "6fd74a17-6065-47a5-b48b-f4e2b8fa7953", + "target": "ea18915f-2c5b-4569-b725-8e9e9122e8d3", + "type": "collapsed" + }, + { + "id": "reactflow__edge-24e9d7ed-4836-4ec4-8f9e-e747721f9818clip-c41e705b-f2e3-4d1a-83c4-e34bb9344966clip", + "source": "24e9d7ed-4836-4ec4-8f9e-e747721f9818", + "target": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-c41e705b-f2e3-4d1a-83c4-e34bb9344966clip-c3fa6872-2599-4a82-a596-b3446a66cf8bclip", + "source": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "target": "c3fa6872-2599-4a82-a596-b3446a66cf8b", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + }, + { + "id": "reactflow__edge-24e9d7ed-4836-4ec4-8f9e-e747721f9818unet-c41e705b-f2e3-4d1a-83c4-e34bb9344966unet", + "source": "24e9d7ed-4836-4ec4-8f9e-e747721f9818", + "target": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "type": "default", + "sourceHandle": "unet", + "targetHandle": "unet" + }, + { + "id": "reactflow__edge-c41e705b-f2e3-4d1a-83c4-e34bb9344966unet-ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63unet", + "source": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "target": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "type": "default", + "sourceHandle": "unet", + "targetHandle": "unet" + }, + { + "id": "reactflow__edge-85b77bb2-c67a-416a-b3e8-291abe746c44conditioning-ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63negative_conditioning", + "source": "85b77bb2-c67a-416a-b3e8-291abe746c44", + "target": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "negative_conditioning" + }, + { + "id": "reactflow__edge-c3fa6872-2599-4a82-a596-b3446a66cf8bconditioning-ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63positive_conditioning", + "source": "c3fa6872-2599-4a82-a596-b3446a66cf8b", + "target": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "type": "default", + "sourceHandle": "conditioning", + "targetHandle": "positive_conditioning" + }, + { + "id": "reactflow__edge-ea18915f-2c5b-4569-b725-8e9e9122e8d3noise-ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63noise", + "source": "ea18915f-2c5b-4569-b725-8e9e9122e8d3", + "target": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "type": "default", + "sourceHandle": "noise", + "targetHandle": "noise" + }, + { + "id": "reactflow__edge-6fd74a17-6065-47a5-b48b-f4e2b8fa7953value-ea18915f-2c5b-4569-b725-8e9e9122e8d3seed", + "source": "6fd74a17-6065-47a5-b48b-f4e2b8fa7953", + "target": "ea18915f-2c5b-4569-b725-8e9e9122e8d3", + "type": "default", + "sourceHandle": "value", + "targetHandle": "seed" + }, + { + "id": "reactflow__edge-ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63latents-a9683c0a-6b1f-4a5e-8187-c57e764b3400latents", + "source": "ad487d0c-dcbb-49c5-bb8e-b28d4cbc5a63", + "target": "a9683c0a-6b1f-4a5e-8187-c57e764b3400", + "type": "default", + "sourceHandle": "latents", + "targetHandle": "latents" + }, + { + "id": "reactflow__edge-24e9d7ed-4836-4ec4-8f9e-e747721f9818vae-a9683c0a-6b1f-4a5e-8187-c57e764b3400vae", + "source": "24e9d7ed-4836-4ec4-8f9e-e747721f9818", + "target": "a9683c0a-6b1f-4a5e-8187-c57e764b3400", + "type": "default", + "sourceHandle": "vae", + "targetHandle": "vae" + }, + { + "id": "reactflow__edge-c41e705b-f2e3-4d1a-83c4-e34bb9344966clip-85b77bb2-c67a-416a-b3e8-291abe746c44clip", + "source": "c41e705b-f2e3-4d1a-83c4-e34bb9344966", + "target": "85b77bb2-c67a-416a-b3e8-291abe746c44", + "type": "default", + "sourceHandle": "clip", + "targetHandle": "clip" + } + ] +} \ No newline at end of file From 8d2952695de47792c4c544843dbfc27201e98353 Mon Sep 17 00:00:00 2001 From: Surisen Date: Wed, 20 Dec 2023 13:34:13 +0100 Subject: [PATCH 05/15] translationBot(ui): update translation (Chinese (Simplified)) Currently translated at 99.8% (1363 of 1365 strings) Co-authored-by: Surisen Translate-URL: https://hosted.weblate.org/projects/invokeai/web-ui/zh_Hans/ Translation: InvokeAI/Web UI --- invokeai/frontend/web/public/locales/zh_CN.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/invokeai/frontend/web/public/locales/zh_CN.json b/invokeai/frontend/web/public/locales/zh_CN.json index b0151b8e76..ee12f2ad07 100644 --- a/invokeai/frontend/web/public/locales/zh_CN.json +++ b/invokeai/frontend/web/public/locales/zh_CN.json @@ -1119,7 +1119,10 @@ "deletedInvalidEdge": "已删除无效的边缘 {{source}} -> {{target}}", "unknownInput": "未知输入:{{name}}", "prototypeDesc": "此调用是一个原型 (prototype)。它可能会在本项目更新期间发生破坏性更改,并且随时可能被删除。", - "betaDesc": "此调用尚处于测试阶段。在稳定之前,它可能会在项目更新期间发生破坏性更改。本项目计划长期支持这种调用。" + "betaDesc": "此调用尚处于测试阶段。在稳定之前,它可能会在项目更新期间发生破坏性更改。本项目计划长期支持这种调用。", + "newWorkflow": "新建工作流", + "newWorkflowDesc": "是否创建一个新的工作流?", + "newWorkflowDesc2": "当前工作流有未保存的更改。" }, "controlnet": { "resize": "直接缩放", @@ -1635,7 +1638,7 @@ "openWorkflow": "打开工作流", "clearWorkflowSearchFilter": "清除工作流检索过滤器", "workflowLibrary": "工作流库", - "downloadWorkflow": "下载工作流", + "downloadWorkflow": "保存到文件", "noRecentWorkflows": "无最近工作流", "workflowSaved": "已保存工作流", "workflowIsOpen": "工作流已打开", @@ -1648,8 +1651,9 @@ "deleteWorkflow": "删除工作流", "workflows": "工作流", "noDescription": "无描述", - "uploadWorkflow": "上传工作流", - "userWorkflows": "我的工作流" + "uploadWorkflow": "从文件中加载", + "userWorkflows": "我的工作流", + "newWorkflowCreated": "已创建新的工作流" }, "app": { "storeNotInitialized": "商店尚未初始化" From 475823835f36d6dd38694958aafb8e38e1a6573f Mon Sep 17 00:00:00 2001 From: skunkworxdark Date: Thu, 21 Dec 2023 18:38:45 +0000 Subject: [PATCH 06/15] Update communityNodes.md Addition of my Adapters-Linked and Metadata-linked nodes --- docs/nodes/communityNodes.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/nodes/communityNodes.md b/docs/nodes/communityNodes.md index 46615e5ebd..d730af8308 100644 --- a/docs/nodes/communityNodes.md +++ b/docs/nodes/communityNodes.md @@ -13,6 +13,7 @@ If you'd prefer, you can also just download the whole node folder from the linke To use a community workflow, download the the `.json` node graph file and load it into Invoke AI via the **Load Workflow** button in the Workflow Editor. - Community Nodes + + [Adapters-Linked](#adapters-linked-nodes) + [Average Images](#average-images) + [Clean Image Artifacts After Cut](#clean-image-artifacts-after-cut) + [Close Color Mask](#close-color-mask) @@ -32,8 +33,9 @@ To use a community workflow, download the the `.json` node graph file and load i + [Image Resize Plus](#image-resize-plus) + [Load Video Frame](#load-video-frame) + [Make 3D](#make-3d) - + [Mask Operations](#mask-operations) + + [Mask Operations](#mask-operations) + [Match Histogram](#match-histogram) + + [Metadata-Linked](#metadata-linked-nodes) + [Negative Image](#negative-image) + [Oobabooga](#oobabooga) + [Prompt Tools](#prompt-tools) @@ -51,6 +53,19 @@ To use a community workflow, download the the `.json` node graph file and load i - [Help](#help) +-------------------------------- +### Adapters Linked Nodes + +**Description:** A set of nodes for linked adapters (ControlNet, IP-Adaptor & T2I-Adapter). This allows multiple adapters to be chained together without using a `collect` node which means it can be used inside an `iterate` node without any collecting on every iteration issues. + +- `ControlNet-Linked` - Collects ControlNet info to pass to other nodes. +- `IP-Adapter-Linked` - Collects IP-Adapter info to pass to other nodes. +- `T2I-Adapter-Linked` - Collects T2I-Adapter info to pass to other nodes. + +Note: These are inherited from the core nodes so any update to the core nodes should be reflected in these. + +**Node Link:** https://github.com/skunkworxdark/adapters-linked-nodes + -------------------------------- ### Average Images @@ -307,6 +322,20 @@ See full docs here: https://github.com/skunkworxdark/Prompt-tools-nodes/edit/mai +-------------------------------- +### Metadata Linked Nodes + +**Description:** A set of nodes for Metadata. Collect Metadata from within an `iterate` node & extract metadata from an image. + +- `Metadata Item Linked` - Allows collecting of metadata while within an iterate node with no need for a collect node or conversion to metadata node. +- `Metadata From Image` - Provides Metadata from an image. +- `Metadata To String` - Extracts a String value of a label from metadata. +- `Metadata To Integer` - Extracts an Integer value of a label from metadata. +- `Metadata To Float` - Extracts a Float value of a label from metadata. +- `Metadata To Scheduler` - Extracts a Scheduler value of a label from metadata. + +**Node Link:** https://github.com/skunkworxdark/metadata-linked-nodes + -------------------------------- ### Negative Image From a0d0e9f474fdd97e35ecc52e3feb88f6e5971fa7 Mon Sep 17 00:00:00 2001 From: SoheilRezaei <113804552+SoheilRezaei@users.noreply.github.com> Date: Thu, 21 Dec 2023 14:51:17 -0500 Subject: [PATCH 07/15] Update contributingToFrontend.md The project is no longer using yarn as a package manager and have moved to pnpm, So I wanted to update the documentation on the contribution page. --- .../contribution_guides/contributingToFrontend.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/contributing/contribution_guides/contributingToFrontend.md b/docs/contributing/contribution_guides/contributingToFrontend.md index d1f0fb7d38..b485fb9a8d 100644 --- a/docs/contributing/contribution_guides/contributingToFrontend.md +++ b/docs/contributing/contribution_guides/contributingToFrontend.md @@ -46,17 +46,18 @@ We encourage you to ping @psychedelicious and @blessedcoolant on [Discord](http ```bash node --version ``` -2. Install [yarn classic](https://classic.yarnpkg.com/lang/en/) and confirm it is installed by running this: + +2. Install [pnpm](https://pnpm.io/) and confirm it is installed by running this: ```bash -npm install --global yarn -yarn --version +npm install --global pnpm +pnpm --version ``` -From `invokeai/frontend/web/` run `yarn install` to get everything set up. +From `invokeai/frontend/web/` run `pnpm install` to get everything set up. Start everything in dev mode: 1. Ensure your virtual environment is running -2. Start the dev server: `yarn dev` +2. Start the dev server: `pnpm dev` 3. Start the InvokeAI Nodes backend: `python scripts/invokeai-web.py # run from the repo root` 4. Point your browser to the dev server address e.g. [http://localhost:5173/](http://localhost:5173/) @@ -72,4 +73,4 @@ For a number of technical and logistical reasons, we need to commit UI build art If you submit a PR, there is a good chance we will ask you to include a separate commit with a build of the app. -To build for production, run `yarn build`. \ No newline at end of file +To build for production, run `pnpm build`. From 702d0f68af80755623b69bd01d61da2719725640 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Thu, 21 Dec 2023 15:30:04 -0500 Subject: [PATCH 08/15] remove (Unsaved) if workflow library is disabled --- .../nodes/components/flow/panels/TopPanel/WorkflowName.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx index 97432ae865..8fefc027a6 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/panels/TopPanel/WorkflowName.tsx @@ -2,11 +2,14 @@ import { Text } from '@chakra-ui/layout'; import { useAppSelector } from 'app/store/storeHooks'; import { memo } from 'react'; import { useTranslation } from 'react-i18next'; +import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus'; const TopCenterPanel = () => { const { t } = useTranslation(); const name = useAppSelector((state) => state.workflow.name); const isTouched = useAppSelector((state) => state.workflow.isTouched); + const isWorkflowLibraryEnabled = + useFeatureStatus('workflowLibrary').isFeatureEnabled; return ( { opacity={0.8} > {name || t('workflows.unnamedWorkflow')} - {isTouched ? ` (${t('common.unsaved')})` : ''} + {isTouched && isWorkflowLibraryEnabled ? ` (${t('common.unsaved')})` : ''} ); }; From 2d11d97dad76ce9aebec9f674b7e6c57135e575f Mon Sep 17 00:00:00 2001 From: gogurtenjoyer <36354352+gogurtenjoyer@users.noreply.github.com> Date: Thu, 21 Dec 2023 19:42:47 -0500 Subject: [PATCH 09/15] remove MacOS Sonoma check in devices.py (#5312) * remove MacOS Sonoma check in devices.py As of pytorch 2.1.0, float16 works with our MPS fixes on Sonoma, so the check is no longer needed. * remove unused platform import --- invokeai/backend/util/devices.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/invokeai/backend/util/devices.py b/invokeai/backend/util/devices.py index 84ca7ee02b..0a65f6c67a 100644 --- a/invokeai/backend/util/devices.py +++ b/invokeai/backend/util/devices.py @@ -1,11 +1,9 @@ from __future__ import annotations -import platform from contextlib import nullcontext from typing import Union import torch -from packaging import version from torch import autocast from invokeai.app.services.config import InvokeAIAppConfig @@ -37,7 +35,7 @@ def choose_precision(device: torch.device) -> str: device_name = torch.cuda.get_device_name(device) if not ("GeForce GTX 1660" in device_name or "GeForce GTX 1650" in device_name): return "float16" - elif device.type == "mps" and version.parse(platform.mac_ver()[0]) < version.parse("14.0.0"): + elif device.type == "mps": return "float16" return "float32" From 32ad742f3e9e6aad41665213794514dd39c9a560 Mon Sep 17 00:00:00 2001 From: Brandon <58442074+brandonrising@users.noreply.github.com> Date: Thu, 21 Dec 2023 22:04:44 -0500 Subject: [PATCH 10/15] Ti trigger from prompt util (#5294) * Pull logic for extracting TI triggers into a util function * Remove duplicate regex for ti triggers * Fix linting for ruff * Remove unused imports --- invokeai/app/invocations/compel.py | 6 +++--- invokeai/app/invocations/onnx.py | 4 ++-- invokeai/app/util/ti_utils.py | 8 ++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 invokeai/app/util/ti_utils.py diff --git a/invokeai/app/invocations/compel.py b/invokeai/app/invocations/compel.py index 5494c3261f..49c62cff56 100644 --- a/invokeai/app/invocations/compel.py +++ b/invokeai/app/invocations/compel.py @@ -1,4 +1,3 @@ -import re from dataclasses import dataclass from typing import List, Optional, Union @@ -17,6 +16,7 @@ from invokeai.backend.stable_diffusion.diffusion.conditioning_data import ( from ...backend.model_management.lora import ModelPatcher from ...backend.model_management.models import ModelNotFoundException, ModelType from ...backend.util.devices import torch_dtype +from ..util.ti_utils import extract_ti_triggers_from_prompt from .baseinvocation import ( BaseInvocation, BaseInvocationOutput, @@ -87,7 +87,7 @@ class CompelInvocation(BaseInvocation): # loras = [(context.services.model_manager.get_model(**lora.dict(exclude={"weight"})).context.model, lora.weight) for lora in self.clip.loras] ti_list = [] - for trigger in re.findall(r"<[a-zA-Z0-9., _-]+>", self.prompt): + for trigger in extract_ti_triggers_from_prompt(self.prompt): name = trigger[1:-1] try: ti_list.append( @@ -210,7 +210,7 @@ class SDXLPromptInvocationBase: # loras = [(context.services.model_manager.get_model(**lora.dict(exclude={"weight"})).context.model, lora.weight) for lora in self.clip.loras] ti_list = [] - for trigger in re.findall(r"<[a-zA-Z0-9., _-]+>", prompt): + for trigger in extract_ti_triggers_from_prompt(prompt): name = trigger[1:-1] try: ti_list.append( diff --git a/invokeai/app/invocations/onnx.py b/invokeai/app/invocations/onnx.py index 9eca5e083e..759cfde700 100644 --- a/invokeai/app/invocations/onnx.py +++ b/invokeai/app/invocations/onnx.py @@ -1,7 +1,6 @@ # Copyright (c) 2023 Borisov Sergey (https://github.com/StAlKeR7779) import inspect -import re # from contextlib import ExitStack from typing import List, Literal, Union @@ -21,6 +20,7 @@ from invokeai.backend import BaseModelType, ModelType, SubModelType from ...backend.model_management import ONNXModelPatcher from ...backend.stable_diffusion import PipelineIntermediateState from ...backend.util import choose_torch_device +from ..util.ti_utils import extract_ti_triggers_from_prompt from .baseinvocation import ( BaseInvocation, BaseInvocationOutput, @@ -78,7 +78,7 @@ class ONNXPromptInvocation(BaseInvocation): ] ti_list = [] - for trigger in re.findall(r"<[a-zA-Z0-9., _-]+>", self.prompt): + for trigger in extract_ti_triggers_from_prompt(self.prompt): name = trigger[1:-1] try: ti_list.append( diff --git a/invokeai/app/util/ti_utils.py b/invokeai/app/util/ti_utils.py new file mode 100644 index 0000000000..a66a832b42 --- /dev/null +++ b/invokeai/app/util/ti_utils.py @@ -0,0 +1,8 @@ +import re + + +def extract_ti_triggers_from_prompt(prompt: str) -> list[str]: + ti_triggers = [] + for trigger in re.findall(r"<[a-zA-Z0-9., _-]+>", prompt): + ti_triggers.append(trigger) + return ti_triggers From 4957a360ffa85d23c73ccdb366cc933eab014c87 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 21 Dec 2023 22:31:58 -0500 Subject: [PATCH 11/15] close #5209 --- README.md | 2 +- invokeai/backend/install/check_root.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2bdced1f18..5dc1736f19 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ upgrade script.** See the next section for a Windows recipe. 3. Select option [1] to upgrade to the latest release. 4. Once the upgrade is finished you will be returned to the launcher -menu. Select option [7] "Re-run the configure script to fix a broken +menu. Select option [6] "Re-run the configure script to fix a broken install or to complete a major upgrade". This will run the configure script against the v2.3 directory and diff --git a/invokeai/backend/install/check_root.py b/invokeai/backend/install/check_root.py index 6ee2aa34b7..ee264016b4 100644 --- a/invokeai/backend/install/check_root.py +++ b/invokeai/backend/install/check_root.py @@ -28,7 +28,7 @@ def check_invokeai_root(config: InvokeAIAppConfig): print("== STARTUP ABORTED ==") print("** One or more necessary files is missing from your InvokeAI root directory **") print("** Please rerun the configuration script to fix this problem. **") - print("** From the launcher, selection option [7]. **") + print("** From the launcher, selection option [6]. **") print( '** From the command line, activate the virtual environment and run "invokeai-configure --yes --skip-sd-weights" **' ) From 1225c3fb47719bbf98afdc0ea3ee5310e7847b9d Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 22 Dec 2023 07:30:51 -0500 Subject: [PATCH 12/15] addresses #5224 (#5332) Co-authored-by: Lincoln Stein --- invokeai/app/services/config/config_default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invokeai/app/services/config/config_default.py b/invokeai/app/services/config/config_default.py index a55bcd3a21..180c4a4b3e 100644 --- a/invokeai/app/services/config/config_default.py +++ b/invokeai/app/services/config/config_default.py @@ -356,7 +356,7 @@ class InvokeAIAppConfig(InvokeAISettings): else: root = self.find_root().expanduser().absolute() self.root = root # insulate ourselves from relative paths that may change - return root + return root.resolve() @property def root_dir(self) -> Path: From 78b29db4583abe5ab1763651345e21d14d4af485 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 22 Dec 2023 12:18:12 +1100 Subject: [PATCH 13/15] feat(backend): disable graph library The graph library occasionally causes issues when the default graph changes substantially between versions and pydantic validation fails. See #5289 for an example. We are not currently using the graph library, so we can disable it until we are ready to use it. It's possible that the workflow library will supersede it anyways. --- invokeai/app/api/dependencies.py | 7 +------ invokeai/app/services/invocation_services.py | 5 +---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/invokeai/app/api/dependencies.py b/invokeai/app/api/dependencies.py index 2b88efbb95..eed178ee8b 100644 --- a/invokeai/app/api/dependencies.py +++ b/invokeai/app/api/dependencies.py @@ -29,8 +29,7 @@ from ..services.model_records import ModelRecordServiceSQL from ..services.names.names_default import SimpleNameService from ..services.session_processor.session_processor_default import DefaultSessionProcessor from ..services.session_queue.session_queue_sqlite import SqliteSessionQueue -from ..services.shared.default_graphs import create_system_graphs -from ..services.shared.graph import GraphExecutionState, LibraryGraph +from ..services.shared.graph import GraphExecutionState from ..services.urls.urls_default import LocalUrlService from ..services.workflow_records.workflow_records_sqlite import SqliteWorkflowRecordsStorage from .events import FastAPIEventService @@ -80,7 +79,6 @@ class ApiDependencies: boards = BoardService() events = FastAPIEventService(event_handler_id) graph_execution_manager = SqliteItemStorage[GraphExecutionState](db=db, table_name="graph_executions") - graph_library = SqliteItemStorage[LibraryGraph](db=db, table_name="graphs") image_records = SqliteImageRecordStorage(db=db) images = ImageService() invocation_cache = MemoryInvocationCache(max_cache_size=config.node_cache_size) @@ -107,7 +105,6 @@ class ApiDependencies: configuration=configuration, events=events, graph_execution_manager=graph_execution_manager, - graph_library=graph_library, image_files=image_files, image_records=image_records, images=images, @@ -127,8 +124,6 @@ class ApiDependencies: workflow_records=workflow_records, ) - create_system_graphs(services.graph_library) - ApiDependencies.invoker = Invoker(services) db.clean() diff --git a/invokeai/app/services/invocation_services.py b/invokeai/app/services/invocation_services.py index 6a308ab096..d99a9aff25 100644 --- a/invokeai/app/services/invocation_services.py +++ b/invokeai/app/services/invocation_services.py @@ -27,7 +27,7 @@ if TYPE_CHECKING: from .names.names_base import NameServiceBase from .session_processor.session_processor_base import SessionProcessorBase from .session_queue.session_queue_base import SessionQueueBase - from .shared.graph import GraphExecutionState, LibraryGraph + from .shared.graph import GraphExecutionState from .urls.urls_base import UrlServiceBase from .workflow_records.workflow_records_base import WorkflowRecordsStorageBase @@ -43,7 +43,6 @@ class InvocationServices: configuration: "InvokeAIAppConfig" events: "EventServiceBase" graph_execution_manager: "ItemStorageABC[GraphExecutionState]" - graph_library: "ItemStorageABC[LibraryGraph]" images: "ImageServiceABC" image_records: "ImageRecordStorageBase" image_files: "ImageFileStorageBase" @@ -71,7 +70,6 @@ class InvocationServices: configuration: "InvokeAIAppConfig", events: "EventServiceBase", graph_execution_manager: "ItemStorageABC[GraphExecutionState]", - graph_library: "ItemStorageABC[LibraryGraph]", images: "ImageServiceABC", image_files: "ImageFileStorageBase", image_records: "ImageRecordStorageBase", @@ -97,7 +95,6 @@ class InvocationServices: self.configuration = configuration self.events = events self.graph_execution_manager = graph_execution_manager - self.graph_library = graph_library self.images = images self.image_files = image_files self.image_records = image_records From 756cb9c27e68c3da4961c4c768f88751b6aeaffe Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:58:59 +1100 Subject: [PATCH 14/15] fix(tests): remove graph library from test fixtures --- tests/aa_nodes/test_graph_execution_state.py | 2 -- tests/aa_nodes/test_invoker.py | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/aa_nodes/test_graph_execution_state.py b/tests/aa_nodes/test_graph_execution_state.py index 04dc6af621..b7bf7771a6 100644 --- a/tests/aa_nodes/test_graph_execution_state.py +++ b/tests/aa_nodes/test_graph_execution_state.py @@ -26,7 +26,6 @@ from invokeai.app.services.shared.graph import ( Graph, GraphExecutionState, IterateInvocation, - LibraryGraph, ) from invokeai.backend.util.logging import InvokeAILogger from tests.fixtures.sqlite_database import create_mock_sqlite_database @@ -61,7 +60,6 @@ def mock_services() -> InvocationServices: configuration=configuration, events=TestEventService(), graph_execution_manager=graph_execution_manager, - graph_library=SqliteItemStorage[LibraryGraph](db=db, table_name="graphs"), image_files=None, # type: ignore image_records=None, # type: ignore images=None, # type: ignore diff --git a/tests/aa_nodes/test_invoker.py b/tests/aa_nodes/test_invoker.py index 288beb6e0b..63908193fd 100644 --- a/tests/aa_nodes/test_invoker.py +++ b/tests/aa_nodes/test_invoker.py @@ -24,7 +24,7 @@ from invokeai.app.services.invocation_stats.invocation_stats_default import Invo from invokeai.app.services.invoker import Invoker from invokeai.app.services.item_storage.item_storage_sqlite import SqliteItemStorage from invokeai.app.services.session_queue.session_queue_common import DEFAULT_QUEUE_ID -from invokeai.app.services.shared.graph import Graph, GraphExecutionState, GraphInvocation, LibraryGraph +from invokeai.app.services.shared.graph import Graph, GraphExecutionState, GraphInvocation @pytest.fixture @@ -66,7 +66,6 @@ def mock_services() -> InvocationServices: configuration=configuration, events=TestEventService(), graph_execution_manager=graph_execution_manager, - graph_library=SqliteItemStorage[LibraryGraph](db=db, table_name="graphs"), image_files=None, # type: ignore image_records=None, # type: ignore images=None, # type: ignore From fbede84405a30c55d9d02e8a61bc4ca2d0c20458 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 22 Dec 2023 12:35:57 -0500 Subject: [PATCH 15/15] [feature] Download Queue (#5225) * add base definition of download manager * basic functionality working * add unit tests for download queue * add documentation and FastAPI route * fix docs * add missing test dependency; fix import ordering * fix file path length checking on windows * fix ruff check error * move release() into the __del__ method * disable testing of stderr messages due to issues with pytest capsys fixture * fix unsorted imports * harmonized implementation of start() and stop() calls in download and & install modules * Update invokeai/app/services/download/download_base.py Co-authored-by: Ryan Dick * replace test datadir fixture with tmp_path * replace DownloadJobBase->DownloadJob in download manager documentation * make source and dest arguments to download_queue.download() an AnyHttpURL and Path respectively * fix pydantic typecheck errors in the download unit test * ruff formatting * add "job cancelled" as an event rather than an exception * fix ruff errors * Update invokeai/app/services/download/download_default.py Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com> * use threading.Event to stop service worker threads; handle unfinished job edge cases * remove dangling STOP job definition * fix ruff complaint * fix ruff check again * avoid race condition when start() and stop() are called simultaneously from different threads * avoid race condition in stop() when a job becomes active while shutting down --------- Co-authored-by: Lincoln Stein Co-authored-by: Ryan Dick Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Co-authored-by: Kent Keirsey <31807370+hipsterusername@users.noreply.github.com> --- docs/contributing/DOWNLOAD_QUEUE.md | 277 ++++++++++++ invokeai/app/api/dependencies.py | 3 + invokeai/app/api/routers/download_queue.py | 111 +++++ invokeai/app/api_app.py | 2 + invokeai/app/services/download/__init__.py | 12 + .../app/services/download/download_base.py | 217 +++++++++ .../app/services/download/download_default.py | 418 ++++++++++++++++++ invokeai/app/services/events/events_base.py | 81 ++++ invokeai/app/services/invocation_services.py | 4 + .../model_install/model_install_base.py | 9 +- .../model_install/model_install_default.py | 10 +- mkdocs.yml | 2 + pyproject.toml | 1 + tests/aa_nodes/test_graph_execution_state.py | 1 + tests/aa_nodes/test_invoker.py | 1 + .../services/download/test_download_queue.py | 223 ++++++++++ .../model_install/test_model_install.py | 4 +- 17 files changed, 1367 insertions(+), 9 deletions(-) create mode 100644 docs/contributing/DOWNLOAD_QUEUE.md create mode 100644 invokeai/app/api/routers/download_queue.py create mode 100644 invokeai/app/services/download/__init__.py create mode 100644 invokeai/app/services/download/download_base.py create mode 100644 invokeai/app/services/download/download_default.py create mode 100644 tests/app/services/download/test_download_queue.py diff --git a/docs/contributing/DOWNLOAD_QUEUE.md b/docs/contributing/DOWNLOAD_QUEUE.md new file mode 100644 index 0000000000..d43c670d2c --- /dev/null +++ b/docs/contributing/DOWNLOAD_QUEUE.md @@ -0,0 +1,277 @@ +# The InvokeAI Download Queue + +The DownloadQueueService provides a multithreaded parallel download +queue for arbitrary URLs, with queue prioritization, event handling, +and restart capabilities. + +## Simple Example + +``` +from invokeai.app.services.download import DownloadQueueService, TqdmProgress + +download_queue = DownloadQueueService() +for url in ['https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/a-painting-of-a-fire.png?raw=true', + 'https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/birdhouse.png?raw=true', + 'https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/missing.png', + 'https://civitai.com/api/download/models/152309?type=Model&format=SafeTensor', + ]: + + # urls start downloading as soon as download() is called + download_queue.download(source=url, + dest='/tmp/downloads', + on_progress=TqdmProgress().update + ) + +download_queue.join() # wait for all downloads to finish +for job in download_queue.list_jobs(): + print(job.model_dump_json(exclude_none=True, indent=4),"\n") +``` + +Output: + +``` +{ + "source": "https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/a-painting-of-a-fire.png?raw=true", + "dest": "/tmp/downloads", + "id": 0, + "priority": 10, + "status": "completed", + "download_path": "/tmp/downloads/a-painting-of-a-fire.png", + "job_started": "2023-12-04T05:34:41.742174", + "job_ended": "2023-12-04T05:34:42.592035", + "bytes": 666734, + "total_bytes": 666734 +} + +{ + "source": "https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/birdhouse.png?raw=true", + "dest": "/tmp/downloads", + "id": 1, + "priority": 10, + "status": "completed", + "download_path": "/tmp/downloads/birdhouse.png", + "job_started": "2023-12-04T05:34:41.741975", + "job_ended": "2023-12-04T05:34:42.652841", + "bytes": 774949, + "total_bytes": 774949 +} + +{ + "source": "https://github.com/invoke-ai/InvokeAI/blob/main/invokeai/assets/missing.png", + "dest": "/tmp/downloads", + "id": 2, + "priority": 10, + "status": "error", + "job_started": "2023-12-04T05:34:41.742079", + "job_ended": "2023-12-04T05:34:42.147625", + "bytes": 0, + "total_bytes": 0, + "error_type": "HTTPError(Not Found)", + "error": "Traceback (most recent call last):\n File \"/home/lstein/Projects/InvokeAI/invokeai/app/services/download/download_default.py\", line 182, in _download_next_item\n self._do_download(job)\n File \"/home/lstein/Projects/InvokeAI/invokeai/app/services/download/download_default.py\", line 206, in _do_download\n raise HTTPError(resp.reason)\nrequests.exceptions.HTTPError: Not Found\n" +} + +{ + "source": "https://civitai.com/api/download/models/152309?type=Model&format=SafeTensor", + "dest": "/tmp/downloads", + "id": 3, + "priority": 10, + "status": "completed", + "download_path": "/tmp/downloads/xl_more_art-full_v1.safetensors", + "job_started": "2023-12-04T05:34:42.147645", + "job_ended": "2023-12-04T05:34:43.735990", + "bytes": 719020768, + "total_bytes": 719020768 +} +``` + +## The API + +The default download queue is `DownloadQueueService`, an +implementation of ABC `DownloadQueueServiceBase`. It juggles multiple +background download requests and provides facilities for interrogating +and cancelling the requests. Access to a current or past download task +is mediated via `DownloadJob` objects which report the current status +of a job request + +### The Queue Object + +A default download queue is located in +`ApiDependencies.invoker.services.download_queue`. However, you can +create additional instances if you need to isolate your queue from the +main one. + +``` +queue = DownloadQueueService(event_bus=events) +``` + +`DownloadQueueService()` takes three optional arguments: + +| **Argument** | **Type** | **Default** | **Description** | +|----------------|-----------------|---------------|-----------------| +| `max_parallel_dl` | int | 5 | Maximum number of simultaneous downloads allowed | +| `event_bus` | EventServiceBase | None | System-wide FastAPI event bus for reporting download events | +| `requests_session` | requests.sessions.Session | None | An alternative requests Session object to use for the download | + +`max_parallel_dl` specifies how many download jobs are allowed to run +simultaneously. Each will run in a different thread of execution. + +`event_bus` is an EventServiceBase, typically the one created at +InvokeAI startup. If present, download events are periodically emitted +on this bus to allow clients to follow download progress. + +`requests_session` is a url library requests Session object. It is +used for testing. + +### The Job object + +The queue operates on a series of download job objects. These objects +specify the source and destination of the download, and keep track of +the progress of the download. + +The only job type currently implemented is `DownloadJob`, a pydantic object with the +following fields: + +| **Field** | **Type** | **Default** | **Description** | +|----------------|-----------------|---------------|-----------------| +| _Fields passed in at job creation time_ | +| `source` | AnyHttpUrl | | Where to download from | +| `dest` | Path | | Where to download to | +| `access_token` | str | | [optional] string containing authentication token for access | +| `on_start` | Callable | | [optional] callback when the download starts | +| `on_progress` | Callable | | [optional] callback called at intervals during download progress | +| `on_complete` | Callable | | [optional] callback called after successful download completion | +| `on_error` | Callable | | [optional] callback called after an error occurs | +| `id` | int | auto assigned | Job ID, an integer >= 0 | +| `priority` | int | 10 | Job priority. Lower priorities run before higher priorities | +| | +| _Fields updated over the course of the download task_ +| `status` | DownloadJobStatus| | Status code | +| `download_path` | Path | | Path to the location of the downloaded file | +| `job_started` | float | | Timestamp for when the job started running | +| `job_ended` | float | | Timestamp for when the job completed or errored out | +| `job_sequence` | int | | A counter that is incremented each time a model is dequeued | +| `bytes` | int | 0 | Bytes downloaded so far | +| `total_bytes` | int | 0 | Total size of the file at the remote site | +| `error_type` | str | | String version of the exception that caused an error during download | +| `error` | str | | String version of the traceback associated with an error | +| `cancelled` | bool | False | Set to true if the job was cancelled by the caller| + +When you create a job, you can assign it a `priority`. If multiple +jobs are queued, the job with the lowest priority runs first. + +Every job has a `source` and a `dest`. `source` is a pydantic.networks AnyHttpUrl object. +The `dest` is a path on the local filesystem that specifies the +destination for the downloaded object. Its semantics are +described below. + +When the job is submitted, it is assigned a numeric `id`. The id can +then be used to fetch the job object from the queue. + +The `status` field is updated by the queue to indicate where the job +is in its lifecycle. Values are defined in the string enum +`DownloadJobStatus`, a symbol available from +`invokeai.app.services.download_manager`. Possible values are: + +| **Value** | **String Value** | ** Description ** | +|--------------|---------------------|-------------------| +| `WAITING` | waiting | Job is on the queue but not yet running| +| `RUNNING` | running | The download is started | +| `COMPLETED` | completed | Job has finished its work without an error | +| `ERROR` | error | Job encountered an error and will not run again| + +`job_started` and `job_ended` indicate when the job +was started (using a python timestamp) and when it completed. + +In case of an error, the job's status will be set to `DownloadJobStatus.ERROR`, the text of the +Exception that caused the error will be placed in the `error_type` +field and the traceback that led to the error will be in `error`. + +A cancelled job will have status `DownloadJobStatus.ERROR` and an +`error_type` field of "DownloadJobCancelledException". In addition, +the job's `cancelled` property will be set to True. + +### Callbacks + +Download jobs can be associated with a series of callbacks, each with +the signature `Callable[["DownloadJob"], None]`. The callbacks are assigned +using optional arguments `on_start`, `on_progress`, `on_complete` and +`on_error`. When the corresponding event occurs, the callback wil be +invoked and passed the job. The callback will be run in a `try:` +context in the same thread as the download job. Any exceptions that +occur during execution of the callback will be caught and converted +into a log error message, thereby allowing the download to continue. + +#### `TqdmProgress` + +The `invokeai.app.services.download.download_default` module defines a +class named `TqdmProgress` which can be used as an `on_progress` +handler to display a completion bar in the console. Use as follows: + +``` +from invokeai.app.services.download import TqdmProgress + +download_queue.download(source='http://some.server.somewhere/some_file', + dest='/tmp/downloads', + on_progress=TqdmProgress().update + ) + +``` + +### Events + +If the queue was initialized with the InvokeAI event bus (the case +when using `ApiDependencies.invoker.services.download_queue`), then +download events will also be issued on the bus. The events are: + +* `download_started` -- This is issued when a job is taken off the +queue and a request is made to the remote server for the URL headers, but before any data +has been downloaded. The event payload will contain the keys `source` +and `download_path`. The latter contains the path that the URL will be +downloaded to. + +* `download_progress -- This is issued periodically as the download +runs. The payload contains the keys `source`, `download_path`, +`current_bytes` and `total_bytes`. The latter two fields can be +used to display the percent complete. + +* `download_complete` -- This is issued when the download completes +successfully. The payload contains the keys `source`, `download_path` +and `total_bytes`. + +* `download_error` -- This is issued when the download stops because +of an error condition. The payload contains the fields `error_type` +and `error`. The former is the text representation of the exception, +and the latter is a traceback showing where the error occurred. + +### Job control + +To create a job call the queue's `download()` method. You can list all +jobs using `list_jobs()`, fetch a single job by its with +`id_to_job()`, cancel a running job with `cancel_job()`, cancel all +running jobs with `cancel_all_jobs()`, and wait for all jobs to finish +with `join()`. + +#### job = queue.download(source, dest, priority, access_token) + +Create a new download job and put it on the queue, returning the +DownloadJob object. + +#### jobs = queue.list_jobs() + +Return a list of all active and inactive `DownloadJob`s. + +#### job = queue.id_to_job(id) + +Return the job corresponding to given ID. + +Return a list of all active and inactive `DownloadJob`s. + +#### queue.prune_jobs() + +Remove inactive (complete or errored) jobs from the listing returned +by `list_jobs()`. + +#### queue.join() + +Block until all pending jobs have run to completion or errored out. + diff --git a/invokeai/app/api/dependencies.py b/invokeai/app/api/dependencies.py index eed178ee8b..9a8e06ac1a 100644 --- a/invokeai/app/api/dependencies.py +++ b/invokeai/app/api/dependencies.py @@ -11,6 +11,7 @@ from ..services.board_images.board_images_default import BoardImagesService from ..services.board_records.board_records_sqlite import SqliteBoardRecordStorage from ..services.boards.boards_default import BoardService from ..services.config import InvokeAIAppConfig +from ..services.download import DownloadQueueService from ..services.image_files.image_files_disk import DiskImageFileStorage from ..services.image_records.image_records_sqlite import SqliteImageRecordStorage from ..services.images.images_default import ImageService @@ -85,6 +86,7 @@ class ApiDependencies: latents = ForwardCacheLatentsStorage(DiskLatentsStorage(f"{output_folder}/latents")) model_manager = ModelManagerService(config, logger) model_record_service = ModelRecordServiceSQL(db=db) + download_queue_service = DownloadQueueService(event_bus=events) model_install_service = ModelInstallService( app_config=config, record_store=model_record_service, event_bus=events ) @@ -113,6 +115,7 @@ class ApiDependencies: logger=logger, model_manager=model_manager, model_records=model_record_service, + download_queue=download_queue_service, model_install=model_install_service, names=names, performance_statistics=performance_statistics, diff --git a/invokeai/app/api/routers/download_queue.py b/invokeai/app/api/routers/download_queue.py new file mode 100644 index 0000000000..92b658c370 --- /dev/null +++ b/invokeai/app/api/routers/download_queue.py @@ -0,0 +1,111 @@ +# Copyright (c) 2023 Lincoln D. Stein +"""FastAPI route for the download queue.""" + +from typing import List, Optional + +from fastapi import Body, Path, Response +from fastapi.routing import APIRouter +from pydantic.networks import AnyHttpUrl +from starlette.exceptions import HTTPException + +from invokeai.app.services.download import ( + DownloadJob, + UnknownJobIDException, +) + +from ..dependencies import ApiDependencies + +download_queue_router = APIRouter(prefix="/v1/download_queue", tags=["download_queue"]) + + +@download_queue_router.get( + "/", + operation_id="list_downloads", +) +async def list_downloads() -> List[DownloadJob]: + """Get a list of active and inactive jobs.""" + queue = ApiDependencies.invoker.services.download_queue + return queue.list_jobs() + + +@download_queue_router.patch( + "/", + operation_id="prune_downloads", + responses={ + 204: {"description": "All completed jobs have been pruned"}, + 400: {"description": "Bad request"}, + }, +) +async def prune_downloads(): + """Prune completed and errored jobs.""" + queue = ApiDependencies.invoker.services.download_queue + queue.prune_jobs() + return Response(status_code=204) + + +@download_queue_router.post( + "/i/", + operation_id="download", +) +async def download( + source: AnyHttpUrl = Body(description="download source"), + dest: str = Body(description="download destination"), + priority: int = Body(default=10, description="queue priority"), + access_token: Optional[str] = Body(default=None, description="token for authorization to download"), +) -> DownloadJob: + """Download the source URL to the file or directory indicted in dest.""" + queue = ApiDependencies.invoker.services.download_queue + return queue.download(source, dest, priority, access_token) + + +@download_queue_router.get( + "/i/{id}", + operation_id="get_download_job", + responses={ + 200: {"description": "Success"}, + 404: {"description": "The requested download JobID could not be found"}, + }, +) +async def get_download_job( + id: int = Path(description="ID of the download job to fetch."), +) -> DownloadJob: + """Get a download job using its ID.""" + try: + job = ApiDependencies.invoker.services.download_queue.id_to_job(id) + return job + except UnknownJobIDException as e: + raise HTTPException(status_code=404, detail=str(e)) + + +@download_queue_router.delete( + "/i/{id}", + operation_id="cancel_download_job", + responses={ + 204: {"description": "Job has been cancelled"}, + 404: {"description": "The requested download JobID could not be found"}, + }, +) +async def cancel_download_job( + id: int = Path(description="ID of the download job to cancel."), +): + """Cancel a download job using its ID.""" + try: + queue = ApiDependencies.invoker.services.download_queue + job = queue.id_to_job(id) + queue.cancel_job(job) + return Response(status_code=204) + except UnknownJobIDException as e: + raise HTTPException(status_code=404, detail=str(e)) + + +@download_queue_router.delete( + "/i", + operation_id="cancel_all_download_jobs", + responses={ + 204: {"description": "Download jobs have been cancelled"}, + }, +) +async def cancel_all_download_jobs(): + """Cancel all download jobs.""" + ApiDependencies.invoker.services.download_queue.cancel_all_jobs() + return Response(status_code=204) diff --git a/invokeai/app/api_app.py b/invokeai/app/api_app.py index ea28cdfe8e..8cbae23399 100644 --- a/invokeai/app/api_app.py +++ b/invokeai/app/api_app.py @@ -45,6 +45,7 @@ if True: # hack to make flake8 happy with imports coming after setting up the c app_info, board_images, boards, + download_queue, images, model_records, models, @@ -116,6 +117,7 @@ app.include_router(sessions.session_router, prefix="/api") app.include_router(utilities.utilities_router, prefix="/api") app.include_router(models.models_router, prefix="/api") app.include_router(model_records.model_records_router, prefix="/api") +app.include_router(download_queue.download_queue_router, prefix="/api") app.include_router(images.images_router, prefix="/api") app.include_router(boards.boards_router, prefix="/api") app.include_router(board_images.board_images_router, prefix="/api") diff --git a/invokeai/app/services/download/__init__.py b/invokeai/app/services/download/__init__.py new file mode 100644 index 0000000000..04c1dfdb1d --- /dev/null +++ b/invokeai/app/services/download/__init__.py @@ -0,0 +1,12 @@ +"""Init file for download queue.""" +from .download_base import DownloadJob, DownloadJobStatus, DownloadQueueServiceBase, UnknownJobIDException +from .download_default import DownloadQueueService, TqdmProgress + +__all__ = [ + "DownloadJob", + "DownloadQueueServiceBase", + "DownloadQueueService", + "TqdmProgress", + "DownloadJobStatus", + "UnknownJobIDException", +] diff --git a/invokeai/app/services/download/download_base.py b/invokeai/app/services/download/download_base.py new file mode 100644 index 0000000000..7ac5425443 --- /dev/null +++ b/invokeai/app/services/download/download_base.py @@ -0,0 +1,217 @@ +# Copyright (c) 2023 Lincoln D. Stein and the InvokeAI Development Team +"""Model download service.""" + +from abc import ABC, abstractmethod +from enum import Enum +from functools import total_ordering +from pathlib import Path +from typing import Any, Callable, List, Optional + +from pydantic import BaseModel, Field, PrivateAttr +from pydantic.networks import AnyHttpUrl + + +class DownloadJobStatus(str, Enum): + """State of a download job.""" + + WAITING = "waiting" # not enqueued, will not run + RUNNING = "running" # actively downloading + COMPLETED = "completed" # finished running + CANCELLED = "cancelled" # user cancelled + ERROR = "error" # terminated with an error message + + +class DownloadJobCancelledException(Exception): + """This exception is raised when a download job is cancelled.""" + + +class UnknownJobIDException(Exception): + """This exception is raised when an invalid job id is referened.""" + + +class ServiceInactiveException(Exception): + """This exception is raised when user attempts to initiate a download before the service is started.""" + + +DownloadEventHandler = Callable[["DownloadJob"], None] + + +@total_ordering +class DownloadJob(BaseModel): + """Class to monitor and control a model download request.""" + + # required variables to be passed in on creation + source: AnyHttpUrl = Field(description="Where to download from. Specific types specified in child classes.") + dest: Path = Field(description="Destination of downloaded model on local disk; a directory or file path") + access_token: Optional[str] = Field(default=None, description="authorization token for protected resources") + # automatically assigned on creation + id: int = Field(description="Numeric ID of this job", default=-1) # default id is a sentinel + priority: int = Field(default=10, description="Queue priority; lower values are higher priority") + + # set internally during download process + status: DownloadJobStatus = Field(default=DownloadJobStatus.WAITING, description="Status of the download") + download_path: Optional[Path] = Field(default=None, description="Final location of downloaded file") + job_started: Optional[str] = Field(default=None, description="Timestamp for when the download job started") + job_ended: Optional[str] = Field( + default=None, description="Timestamp for when the download job ende1d (completed or errored)" + ) + bytes: int = Field(default=0, description="Bytes downloaded so far") + total_bytes: int = Field(default=0, description="Total file size (bytes)") + + # set when an error occurs + error_type: Optional[str] = Field(default=None, description="Name of exception that caused an error") + error: Optional[str] = Field(default=None, description="Traceback of the exception that caused an error") + + # internal flag + _cancelled: bool = PrivateAttr(default=False) + + # optional event handlers passed in on creation + _on_start: Optional[DownloadEventHandler] = PrivateAttr(default=None) + _on_progress: Optional[DownloadEventHandler] = PrivateAttr(default=None) + _on_complete: Optional[DownloadEventHandler] = PrivateAttr(default=None) + _on_cancelled: Optional[DownloadEventHandler] = PrivateAttr(default=None) + _on_error: Optional[DownloadEventHandler] = PrivateAttr(default=None) + + def __le__(self, other: "DownloadJob") -> bool: + """Return True if this job's priority is less than another's.""" + return self.priority <= other.priority + + def cancel(self) -> None: + """Call to cancel the job.""" + self._cancelled = True + + # cancelled and the callbacks are private attributes in order to prevent + # them from being serialized and/or used in the Json Schema + @property + def cancelled(self) -> bool: + """Call to cancel the job.""" + return self._cancelled + + @property + def on_start(self) -> Optional[DownloadEventHandler]: + """Return the on_start event handler.""" + return self._on_start + + @property + def on_progress(self) -> Optional[DownloadEventHandler]: + """Return the on_progress event handler.""" + return self._on_progress + + @property + def on_complete(self) -> Optional[DownloadEventHandler]: + """Return the on_complete event handler.""" + return self._on_complete + + @property + def on_error(self) -> Optional[DownloadEventHandler]: + """Return the on_error event handler.""" + return self._on_error + + @property + def on_cancelled(self) -> Optional[DownloadEventHandler]: + """Return the on_cancelled event handler.""" + return self._on_cancelled + + def set_callbacks( + self, + on_start: Optional[DownloadEventHandler] = None, + on_progress: Optional[DownloadEventHandler] = None, + on_complete: Optional[DownloadEventHandler] = None, + on_cancelled: Optional[DownloadEventHandler] = None, + on_error: Optional[DownloadEventHandler] = None, + ) -> None: + """Set the callbacks for download events.""" + self._on_start = on_start + self._on_progress = on_progress + self._on_complete = on_complete + self._on_error = on_error + self._on_cancelled = on_cancelled + + +class DownloadQueueServiceBase(ABC): + """Multithreaded queue for downloading models via URL.""" + + @abstractmethod + def start(self, *args: Any, **kwargs: Any) -> None: + """Start the download worker threads.""" + + @abstractmethod + def stop(self, *args: Any, **kwargs: Any) -> None: + """Stop the download worker threads.""" + + @abstractmethod + def download( + self, + source: AnyHttpUrl, + dest: Path, + priority: int = 10, + access_token: Optional[str] = None, + on_start: Optional[DownloadEventHandler] = None, + on_progress: Optional[DownloadEventHandler] = None, + on_complete: Optional[DownloadEventHandler] = None, + on_cancelled: Optional[DownloadEventHandler] = None, + on_error: Optional[DownloadEventHandler] = None, + ) -> DownloadJob: + """ + Create a download job. + + :param source: Source of the download as a URL. + :param dest: Path to download to. See below. + :param on_start, on_progress, on_complete, on_error: Callbacks for the indicated + events. + :returns: A DownloadJob object for monitoring the state of the download. + + The `dest` argument is a Path object. Its behavior is: + + 1. If the path exists and is a directory, then the URL contents will be downloaded + into that directory using the filename indicated in the response's `Content-Disposition` field. + If no content-disposition is present, then the last component of the URL will be used (similar to + wget's behavior). + 2. If the path does not exist, then it is taken as the name of a new file to create with the downloaded + content. + 3. If the path exists and is an existing file, then the downloader will try to resume the download from + the end of the existing file. + + """ + pass + + @abstractmethod + def list_jobs(self) -> List[DownloadJob]: + """ + List active download jobs. + + :returns List[DownloadJob]: List of download jobs whose state is not "completed." + """ + pass + + @abstractmethod + def id_to_job(self, id: int) -> DownloadJob: + """ + Return the DownloadJob corresponding to the integer ID. + + :param id: ID of the DownloadJob. + + Exceptions: + * UnknownJobIDException + """ + pass + + @abstractmethod + def cancel_all_jobs(self): + """Cancel all active and enquedjobs.""" + pass + + @abstractmethod + def prune_jobs(self): + """Prune completed and errored queue items from the job list.""" + pass + + @abstractmethod + def cancel_job(self, job: DownloadJob): + """Cancel the job, clearing partial downloads and putting it into ERROR state.""" + pass + + @abstractmethod + def join(self): + """Wait until all jobs are off the queue.""" + pass diff --git a/invokeai/app/services/download/download_default.py b/invokeai/app/services/download/download_default.py new file mode 100644 index 0000000000..0f1dca4adc --- /dev/null +++ b/invokeai/app/services/download/download_default.py @@ -0,0 +1,418 @@ +# Copyright (c) 2023, Lincoln D. Stein +"""Implementation of multithreaded download queue for invokeai.""" + +import os +import re +import threading +import traceback +from logging import Logger +from pathlib import Path +from queue import Empty, PriorityQueue +from typing import Any, Dict, List, Optional, Set + +import requests +from pydantic.networks import AnyHttpUrl +from requests import HTTPError +from tqdm import tqdm + +from invokeai.app.services.events.events_base import EventServiceBase +from invokeai.app.util.misc import get_iso_timestamp +from invokeai.backend.util.logging import InvokeAILogger + +from .download_base import ( + DownloadEventHandler, + DownloadJob, + DownloadJobCancelledException, + DownloadJobStatus, + DownloadQueueServiceBase, + ServiceInactiveException, + UnknownJobIDException, +) + +# Maximum number of bytes to download during each call to requests.iter_content() +DOWNLOAD_CHUNK_SIZE = 100000 + + +class DownloadQueueService(DownloadQueueServiceBase): + """Class for queued download of models.""" + + _jobs: Dict[int, DownloadJob] + _max_parallel_dl: int = 5 + _worker_pool: Set[threading.Thread] + _queue: PriorityQueue[DownloadJob] + _stop_event: threading.Event + _lock: threading.Lock + _logger: Logger + _events: Optional[EventServiceBase] = None + _next_job_id: int = 0 + _accept_download_requests: bool = False + _requests: requests.sessions.Session + + def __init__( + self, + max_parallel_dl: int = 5, + event_bus: Optional[EventServiceBase] = None, + requests_session: Optional[requests.sessions.Session] = None, + ): + """ + Initialize DownloadQueue. + + :param max_parallel_dl: Number of simultaneous downloads allowed [5]. + :param requests_session: Optional requests.sessions.Session object, for unit tests. + """ + self._jobs = {} + self._next_job_id = 0 + self._queue = PriorityQueue() + self._stop_event = threading.Event() + self._worker_pool = set() + self._lock = threading.Lock() + self._logger = InvokeAILogger.get_logger("DownloadQueueService") + self._event_bus = event_bus + self._requests = requests_session or requests.Session() + self._accept_download_requests = False + self._max_parallel_dl = max_parallel_dl + + def start(self, *args: Any, **kwargs: Any) -> None: + """Start the download worker threads.""" + with self._lock: + if self._worker_pool: + raise Exception("Attempt to start the download service twice") + self._stop_event.clear() + self._start_workers(self._max_parallel_dl) + self._accept_download_requests = True + + def stop(self, *args: Any, **kwargs: Any) -> None: + """Stop the download worker threads.""" + with self._lock: + if not self._worker_pool: + raise Exception("Attempt to stop the download service before it was started") + self._accept_download_requests = False # reject attempts to add new jobs to queue + queued_jobs = [x for x in self.list_jobs() if x.status == DownloadJobStatus.WAITING] + active_jobs = [x for x in self.list_jobs() if x.status == DownloadJobStatus.RUNNING] + if queued_jobs: + self._logger.warning(f"Cancelling {len(queued_jobs)} queued downloads") + if active_jobs: + self._logger.info(f"Waiting for {len(active_jobs)} active download jobs to complete") + with self._queue.mutex: + self._queue.queue.clear() + self.join() # wait for all active jobs to finish + self._stop_event.set() + self._worker_pool.clear() + + def download( + self, + source: AnyHttpUrl, + dest: Path, + priority: int = 10, + access_token: Optional[str] = None, + on_start: Optional[DownloadEventHandler] = None, + on_progress: Optional[DownloadEventHandler] = None, + on_complete: Optional[DownloadEventHandler] = None, + on_cancelled: Optional[DownloadEventHandler] = None, + on_error: Optional[DownloadEventHandler] = None, + ) -> DownloadJob: + """Create a download job and return its ID.""" + if not self._accept_download_requests: + raise ServiceInactiveException( + "The download service is not currently accepting requests. Please call start() to initialize the service." + ) + with self._lock: + id = self._next_job_id + self._next_job_id += 1 + job = DownloadJob( + id=id, + source=source, + dest=dest, + priority=priority, + access_token=access_token, + ) + job.set_callbacks( + on_start=on_start, + on_progress=on_progress, + on_complete=on_complete, + on_cancelled=on_cancelled, + on_error=on_error, + ) + self._jobs[id] = job + self._queue.put(job) + return job + + def join(self) -> None: + """Wait for all jobs to complete.""" + self._queue.join() + + def list_jobs(self) -> List[DownloadJob]: + """List all the jobs.""" + return list(self._jobs.values()) + + def prune_jobs(self) -> None: + """Prune completed and errored queue items from the job list.""" + with self._lock: + to_delete = set() + for job_id, job in self._jobs.items(): + if self._in_terminal_state(job): + to_delete.add(job_id) + for job_id in to_delete: + del self._jobs[job_id] + + def id_to_job(self, id: int) -> DownloadJob: + """Translate a job ID into a DownloadJob object.""" + try: + return self._jobs[id] + except KeyError as excp: + raise UnknownJobIDException("Unrecognized job") from excp + + def cancel_job(self, job: DownloadJob) -> None: + """ + Cancel the indicated job. + + If it is running it will be stopped. + job.status will be set to DownloadJobStatus.CANCELLED + """ + with self._lock: + job.cancel() + + def cancel_all_jobs(self, preserve_partial: bool = False) -> None: + """Cancel all jobs (those not in enqueued, running or paused state).""" + for job in self._jobs.values(): + if not self._in_terminal_state(job): + self.cancel_job(job) + + def _in_terminal_state(self, job: DownloadJob) -> bool: + return job.status in [ + DownloadJobStatus.COMPLETED, + DownloadJobStatus.CANCELLED, + DownloadJobStatus.ERROR, + ] + + def _start_workers(self, max_workers: int) -> None: + """Start the requested number of worker threads.""" + self._stop_event.clear() + for i in range(0, max_workers): # noqa B007 + worker = threading.Thread(target=self._download_next_item, daemon=True) + self._logger.debug(f"Download queue worker thread {worker.name} starting.") + worker.start() + self._worker_pool.add(worker) + + def _download_next_item(self) -> None: + """Worker thread gets next job on priority queue.""" + done = False + while not done: + if self._stop_event.is_set(): + done = True + continue + try: + job = self._queue.get(timeout=1) + except Empty: + continue + + try: + job.job_started = get_iso_timestamp() + self._do_download(job) + self._signal_job_complete(job) + + except (OSError, HTTPError) as excp: + job.error_type = excp.__class__.__name__ + f"({str(excp)})" + job.error = traceback.format_exc() + self._signal_job_error(job) + except DownloadJobCancelledException: + self._signal_job_cancelled(job) + self._cleanup_cancelled_job(job) + + finally: + job.job_ended = get_iso_timestamp() + self._queue.task_done() + self._logger.debug(f"Download queue worker thread {threading.current_thread().name} exiting.") + + def _do_download(self, job: DownloadJob) -> None: + """Do the actual download.""" + url = job.source + header = {"Authorization": f"Bearer {job.access_token}"} if job.access_token else {} + open_mode = "wb" + + # Make a streaming request. This will retrieve headers including + # content-length and content-disposition, but not fetch any content itself + resp = self._requests.get(str(url), headers=header, stream=True) + if not resp.ok: + raise HTTPError(resp.reason) + content_length = int(resp.headers.get("content-length", 0)) + job.total_bytes = content_length + + if job.dest.is_dir(): + file_name = os.path.basename(str(url.path)) # default is to use the last bit of the URL + + if match := re.search('filename="(.+)"', resp.headers.get("Content-Disposition", "")): + remote_name = match.group(1) + if self._validate_filename(job.dest.as_posix(), remote_name): + file_name = remote_name + + job.download_path = job.dest / file_name + + else: + job.dest.parent.mkdir(parents=True, exist_ok=True) + job.download_path = job.dest + + assert job.download_path + + # Don't clobber an existing file. See commit 82c2c85202f88c6d24ff84710f297cfc6ae174af + # for code that instead resumes an interrupted download. + if job.download_path.exists(): + raise OSError(f"[Errno 17] File {job.download_path} exists") + + # append ".downloading" to the path + in_progress_path = self._in_progress_path(job.download_path) + + # signal caller that the download is starting. At this point, key fields such as + # download_path and total_bytes will be populated. We call it here because the might + # discover that the local file is already complete and generate a COMPLETED status. + self._signal_job_started(job) + + # "range not satisfiable" - local file is at least as large as the remote file + if resp.status_code == 416 or (content_length > 0 and job.bytes >= content_length): + self._logger.warning(f"{job.download_path}: complete file found. Skipping.") + return + + # "partial content" - local file is smaller than remote file + elif resp.status_code == 206 or job.bytes > 0: + self._logger.warning(f"{job.download_path}: partial file found. Resuming") + + # some other error + elif resp.status_code != 200: + raise HTTPError(resp.reason) + + self._logger.debug(f"{job.source}: Downloading {job.download_path}") + report_delta = job.total_bytes / 100 # report every 1% change + last_report_bytes = 0 + + # DOWNLOAD LOOP + with open(in_progress_path, open_mode) as file: + for data in resp.iter_content(chunk_size=DOWNLOAD_CHUNK_SIZE): + if job.cancelled: + raise DownloadJobCancelledException("Job was cancelled at caller's request") + + job.bytes += file.write(data) + if (job.bytes - last_report_bytes >= report_delta) or (job.bytes >= job.total_bytes): + last_report_bytes = job.bytes + self._signal_job_progress(job) + + # if we get here we are done and can rename the file to the original dest + in_progress_path.rename(job.download_path) + + def _validate_filename(self, directory: str, filename: str) -> bool: + pc_name_max = os.pathconf(directory, "PC_NAME_MAX") if hasattr(os, "pathconf") else 260 # hardcoded for windows + pc_path_max = ( + os.pathconf(directory, "PC_PATH_MAX") if hasattr(os, "pathconf") else 32767 + ) # hardcoded for windows with long names enabled + if "/" in filename: + return False + if filename.startswith(".."): + return False + if len(filename) > pc_name_max: + return False + if len(os.path.join(directory, filename)) > pc_path_max: + return False + return True + + def _in_progress_path(self, path: Path) -> Path: + return path.with_name(path.name + ".downloading") + + def _signal_job_started(self, job: DownloadJob) -> None: + job.status = DownloadJobStatus.RUNNING + if job.on_start: + try: + job.on_start(job) + except Exception as e: + self._logger.error(e) + if self._event_bus: + assert job.download_path + self._event_bus.emit_download_started(str(job.source), job.download_path.as_posix()) + + def _signal_job_progress(self, job: DownloadJob) -> None: + if job.on_progress: + try: + job.on_progress(job) + except Exception as e: + self._logger.error(e) + if self._event_bus: + assert job.download_path + self._event_bus.emit_download_progress( + str(job.source), + download_path=job.download_path.as_posix(), + current_bytes=job.bytes, + total_bytes=job.total_bytes, + ) + + def _signal_job_complete(self, job: DownloadJob) -> None: + job.status = DownloadJobStatus.COMPLETED + if job.on_complete: + try: + job.on_complete(job) + except Exception as e: + self._logger.error(e) + if self._event_bus: + assert job.download_path + self._event_bus.emit_download_complete( + str(job.source), download_path=job.download_path.as_posix(), total_bytes=job.total_bytes + ) + + def _signal_job_cancelled(self, job: DownloadJob) -> None: + job.status = DownloadJobStatus.CANCELLED + if job.on_cancelled: + try: + job.on_cancelled(job) + except Exception as e: + self._logger.error(e) + if self._event_bus: + self._event_bus.emit_download_cancelled(str(job.source)) + + def _signal_job_error(self, job: DownloadJob) -> None: + job.status = DownloadJobStatus.ERROR + if job.on_error: + try: + job.on_error(job) + except Exception as e: + self._logger.error(e) + if self._event_bus: + assert job.error_type + assert job.error + self._event_bus.emit_download_error(str(job.source), error_type=job.error_type, error=job.error) + + def _cleanup_cancelled_job(self, job: DownloadJob) -> None: + self._logger.warning(f"Cleaning up leftover files from cancelled download job {job.download_path}") + try: + if job.download_path: + partial_file = self._in_progress_path(job.download_path) + partial_file.unlink() + except OSError as excp: + self._logger.warning(excp) + + +# Example on_progress event handler to display a TQDM status bar +# Activate with: +# download_service.download('http://foo.bar/baz', '/tmp', on_progress=TqdmProgress().job_update +class TqdmProgress(object): + """TQDM-based progress bar object to use in on_progress handlers.""" + + _bars: Dict[int, tqdm] # the tqdm object + _last: Dict[int, int] # last bytes downloaded + + def __init__(self) -> None: # noqa D107 + self._bars = {} + self._last = {} + + def update(self, job: DownloadJob) -> None: # noqa D102 + job_id = job.id + # new job + if job_id not in self._bars: + assert job.download_path + dest = Path(job.download_path).name + self._bars[job_id] = tqdm( + desc=dest, + initial=0, + total=job.total_bytes, + unit="iB", + unit_scale=True, + ) + self._last[job_id] = 0 + self._bars[job_id].update(job.bytes - self._last[job_id]) + self._last[job_id] = job.bytes diff --git a/invokeai/app/services/events/events_base.py b/invokeai/app/services/events/events_base.py index 93b84afaf1..16e7d72b2a 100644 --- a/invokeai/app/services/events/events_base.py +++ b/invokeai/app/services/events/events_base.py @@ -17,6 +17,7 @@ from invokeai.backend.model_management.models.base import BaseModelType, ModelTy class EventServiceBase: queue_event: str = "queue_event" + download_event: str = "download_event" model_event: str = "model_event" """Basic event bus, to have an empty stand-in when not needed""" @@ -32,6 +33,13 @@ class EventServiceBase: payload={"event": event_name, "data": payload}, ) + def __emit_download_event(self, event_name: str, payload: dict) -> None: + payload["timestamp"] = get_timestamp() + self.dispatch( + event_name=EventServiceBase.download_event, + payload={"event": event_name, "data": payload}, + ) + def __emit_model_event(self, event_name: str, payload: dict) -> None: payload["timestamp"] = get_timestamp() self.dispatch( @@ -323,6 +331,79 @@ class EventServiceBase: payload={"queue_id": queue_id}, ) + def emit_download_started(self, source: str, download_path: str) -> None: + """ + Emit when a download job is started. + + :param url: The downloaded url + """ + self.__emit_download_event( + event_name="download_started", + payload={"source": source, "download_path": download_path}, + ) + + def emit_download_progress(self, source: str, download_path: str, current_bytes: int, total_bytes: int) -> None: + """ + Emit "download_progress" events at regular intervals during a download job. + + :param source: The downloaded source + :param download_path: The local downloaded file + :param current_bytes: Number of bytes downloaded so far + :param total_bytes: The size of the file being downloaded (if known) + """ + self.__emit_download_event( + event_name="download_progress", + payload={ + "source": source, + "download_path": download_path, + "current_bytes": current_bytes, + "total_bytes": total_bytes, + }, + ) + + def emit_download_complete(self, source: str, download_path: str, total_bytes: int) -> None: + """ + Emit a "download_complete" event at the end of a successful download. + + :param source: Source URL + :param download_path: Path to the locally downloaded file + :param total_bytes: The size of the downloaded file + """ + self.__emit_download_event( + event_name="download_complete", + payload={ + "source": source, + "download_path": download_path, + "total_bytes": total_bytes, + }, + ) + + def emit_download_cancelled(self, source: str) -> None: + """Emit a "download_cancelled" event in the event that the download was cancelled by user.""" + self.__emit_download_event( + event_name="download_cancelled", + payload={ + "source": source, + }, + ) + + def emit_download_error(self, source: str, error_type: str, error: str) -> None: + """ + Emit a "download_error" event when an download job encounters an exception. + + :param source: Source URL + :param error_type: The name of the exception that raised the error + :param error: The traceback from this error + """ + self.__emit_download_event( + event_name="download_error", + payload={ + "source": source, + "error_type": error_type, + "error": error, + }, + ) + def emit_model_install_started(self, source: str) -> None: """ Emitted when an install job is started. diff --git a/invokeai/app/services/invocation_services.py b/invokeai/app/services/invocation_services.py index d99a9aff25..11a4de99d6 100644 --- a/invokeai/app/services/invocation_services.py +++ b/invokeai/app/services/invocation_services.py @@ -11,6 +11,7 @@ if TYPE_CHECKING: from .board_records.board_records_base import BoardRecordStorageBase from .boards.boards_base import BoardServiceABC from .config import InvokeAIAppConfig + from .download import DownloadQueueServiceBase from .events.events_base import EventServiceBase from .image_files.image_files_base import ImageFileStorageBase from .image_records.image_records_base import ImageRecordStorageBase @@ -50,6 +51,7 @@ class InvocationServices: logger: "Logger" model_manager: "ModelManagerServiceBase" model_records: "ModelRecordServiceBase" + download_queue: "DownloadQueueServiceBase" model_install: "ModelInstallServiceBase" processor: "InvocationProcessorABC" performance_statistics: "InvocationStatsServiceBase" @@ -77,6 +79,7 @@ class InvocationServices: logger: "Logger", model_manager: "ModelManagerServiceBase", model_records: "ModelRecordServiceBase", + download_queue: "DownloadQueueServiceBase", model_install: "ModelInstallServiceBase", processor: "InvocationProcessorABC", performance_statistics: "InvocationStatsServiceBase", @@ -102,6 +105,7 @@ class InvocationServices: self.logger = logger self.model_manager = model_manager self.model_records = model_records + self.download_queue = download_queue self.model_install = model_install self.processor = processor self.performance_statistics = performance_statistics diff --git a/invokeai/app/services/model_install/model_install_base.py b/invokeai/app/services/model_install/model_install_base.py index 80b493d02e..3146b5350a 100644 --- a/invokeai/app/services/model_install/model_install_base.py +++ b/invokeai/app/services/model_install/model_install_base.py @@ -11,7 +11,6 @@ from typing_extensions import Annotated from invokeai.app.services.config import InvokeAIAppConfig from invokeai.app.services.events import EventServiceBase -from invokeai.app.services.invoker import Invoker from invokeai.app.services.model_records import ModelRecordServiceBase from invokeai.backend.model_manager import AnyModelConfig @@ -157,12 +156,12 @@ class ModelInstallServiceBase(ABC): :param event_bus: InvokeAI event bus for reporting events to. """ - def start(self, invoker: Invoker) -> None: - """Call at InvokeAI startup time.""" - self.sync_to_config() + @abstractmethod + def start(self, *args: Any, **kwarg: Any) -> None: + """Start the installer service.""" @abstractmethod - def stop(self) -> None: + def stop(self, *args: Any, **kwarg: Any) -> None: """Stop the model install service. After this the objection can be safely deleted.""" @property diff --git a/invokeai/app/services/model_install/model_install_default.py b/invokeai/app/services/model_install/model_install_default.py index 70cc4d5018..3dcb7c527e 100644 --- a/invokeai/app/services/model_install/model_install_default.py +++ b/invokeai/app/services/model_install/model_install_default.py @@ -71,7 +71,6 @@ class ModelInstallService(ModelInstallServiceBase): self._install_queue = Queue() self._cached_model_paths = set() self._models_installed = set() - self._start_installer_thread() @property def app_config(self) -> InvokeAIAppConfig: # noqa D102 @@ -85,8 +84,13 @@ class ModelInstallService(ModelInstallServiceBase): def event_bus(self) -> Optional[EventServiceBase]: # noqa D102 return self._event_bus - def stop(self, *args, **kwargs) -> None: - """Stop the install thread; after this the object can be deleted and garbage collected.""" + def start(self, *args: Any, **kwarg: Any) -> None: + """Start the installer thread.""" + self._start_installer_thread() + self.sync_to_config() + + def stop(self, *args: Any, **kwarg: Any) -> None: + """Stop the installer thread; after this the object can be deleted and garbage collected.""" self._install_queue.put(STOP_JOB) def _start_installer_thread(self) -> None: diff --git a/mkdocs.yml b/mkdocs.yml index 7c67a2777a..c8875c0ff1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -172,6 +172,8 @@ nav: - Adding Tests: 'contributing/TESTS.md' - Documentation: 'contributing/contribution_guides/documentation.md' - Nodes: 'contributing/INVOCATIONS.md' + - Model Manager: 'contributing/MODEL_MANAGER.md' + - Download Queue: 'contributing/DOWNLOAD_QUEUE.md' - Translation: 'contributing/contribution_guides/translation.md' - Tutorials: 'contributing/contribution_guides/tutorials.md' - Changelog: 'CHANGELOG.md' diff --git a/pyproject.toml b/pyproject.toml index 98018dc7cb..52fbdd01a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,6 +105,7 @@ dependencies = [ "pytest>6.0.0", "pytest-cov", "pytest-datadir", + "requests_testadapter", ] "xformers" = [ "xformers==0.0.23; sys_platform!='darwin'", diff --git a/tests/aa_nodes/test_graph_execution_state.py b/tests/aa_nodes/test_graph_execution_state.py index b7bf7771a6..bb31161426 100644 --- a/tests/aa_nodes/test_graph_execution_state.py +++ b/tests/aa_nodes/test_graph_execution_state.py @@ -68,6 +68,7 @@ def mock_services() -> InvocationServices: logger=logging, # type: ignore model_manager=None, # type: ignore model_records=None, # type: ignore + download_queue=None, # type: ignore model_install=None, # type: ignore names=None, # type: ignore performance_statistics=InvocationStatsService(), diff --git a/tests/aa_nodes/test_invoker.py b/tests/aa_nodes/test_invoker.py index 63908193fd..d4959282a1 100644 --- a/tests/aa_nodes/test_invoker.py +++ b/tests/aa_nodes/test_invoker.py @@ -74,6 +74,7 @@ def mock_services() -> InvocationServices: logger=logging, # type: ignore model_manager=None, # type: ignore model_records=None, # type: ignore + download_queue=None, # type: ignore model_install=None, # type: ignore names=None, # type: ignore performance_statistics=InvocationStatsService(), diff --git a/tests/app/services/download/test_download_queue.py b/tests/app/services/download/test_download_queue.py new file mode 100644 index 0000000000..6e36af75ce --- /dev/null +++ b/tests/app/services/download/test_download_queue.py @@ -0,0 +1,223 @@ +"""Test the queued download facility""" +import re +import time +from pathlib import Path +from typing import Any, Dict, List + +import pytest +import requests +from pydantic import BaseModel +from pydantic.networks import AnyHttpUrl +from requests.sessions import Session +from requests_testadapter import TestAdapter + +from invokeai.app.services.download import DownloadJob, DownloadJobStatus, DownloadQueueService +from invokeai.app.services.events.events_base import EventServiceBase + +# Prevent pytest deprecation warnings +TestAdapter.__test__ = False + + +@pytest.fixture +def session() -> requests.sessions.Session: + sess = requests.Session() + for i in ["12345", "9999", "54321"]: + content = ( + b"I am a safetensors file " + bytearray(i, "utf-8") + bytearray(32_000) + ) # for pause tests, must make content large + sess.mount( + f"http://www.civitai.com/models/{i}", + TestAdapter( + content, + headers={ + "Content-Length": len(content), + "Content-Disposition": f'filename="mock{i}.safetensors"', + }, + ), + ) + + # here are some malformed URLs to test + # missing the content length + sess.mount( + "http://www.civitai.com/models/missing", + TestAdapter( + b"Missing content length", + headers={ + "Content-Disposition": 'filename="missing.txt"', + }, + ), + ) + # not found test + sess.mount("http://www.civitai.com/models/broken", TestAdapter(b"Not found", status=404)) + + return sess + + +class DummyEvent(BaseModel): + """Dummy Event to use with Dummy Event service.""" + + event_name: str + payload: Dict[str, Any] + + +# A dummy event service for testing event issuing +class DummyEventService(EventServiceBase): + """Dummy event service for testing.""" + + events: List[DummyEvent] + + def __init__(self) -> None: + super().__init__() + self.events = [] + + def dispatch(self, event_name: str, payload: Any) -> None: + """Dispatch an event by appending it to self.events.""" + self.events.append(DummyEvent(event_name=payload["event"], payload=payload["data"])) + + +def test_basic_queue_download(tmp_path: Path, session: Session) -> None: + events = set() + + def event_handler(job: DownloadJob) -> None: + events.add(job.status) + + queue = DownloadQueueService( + requests_session=session, + ) + queue.start() + job = queue.download( + source=AnyHttpUrl("http://www.civitai.com/models/12345"), + dest=tmp_path, + on_start=event_handler, + on_progress=event_handler, + on_complete=event_handler, + on_error=event_handler, + ) + assert isinstance(job, DownloadJob), "expected the job to be of type DownloadJobBase" + assert isinstance(job.id, int), "expected the job id to be numeric" + queue.join() + + assert job.status == DownloadJobStatus("completed"), "expected job status to be completed" + assert Path(tmp_path, "mock12345.safetensors").exists(), f"expected {tmp_path}/mock12345.safetensors to exist" + + assert events == {DownloadJobStatus.RUNNING, DownloadJobStatus.COMPLETED} + queue.stop() + + +def test_errors(tmp_path: Path, session: Session) -> None: + queue = DownloadQueueService( + requests_session=session, + ) + queue.start() + + for bad_url in ["http://www.civitai.com/models/broken", "http://www.civitai.com/models/missing"]: + queue.download(AnyHttpUrl(bad_url), dest=tmp_path) + + queue.join() + jobs = queue.list_jobs() + print(jobs) + assert len(jobs) == 2 + jobs_dict = {str(x.source): x for x in jobs} + assert jobs_dict["http://www.civitai.com/models/broken"].status == DownloadJobStatus.ERROR + assert jobs_dict["http://www.civitai.com/models/broken"].error_type == "HTTPError(NOT FOUND)" + assert jobs_dict["http://www.civitai.com/models/missing"].status == DownloadJobStatus.COMPLETED + assert jobs_dict["http://www.civitai.com/models/missing"].total_bytes == 0 + queue.stop() + + +def test_event_bus(tmp_path: Path, session: Session) -> None: + event_bus = DummyEventService() + + queue = DownloadQueueService(requests_session=session, event_bus=event_bus) + queue.start() + queue.download( + source=AnyHttpUrl("http://www.civitai.com/models/12345"), + dest=tmp_path, + ) + queue.join() + events = event_bus.events + assert len(events) == 3 + assert events[0].payload["timestamp"] <= events[1].payload["timestamp"] + assert events[1].payload["timestamp"] <= events[2].payload["timestamp"] + assert events[0].event_name == "download_started" + assert events[1].event_name == "download_progress" + assert events[1].payload["total_bytes"] > 0 + assert events[1].payload["current_bytes"] <= events[1].payload["total_bytes"] + assert events[2].event_name == "download_complete" + assert events[2].payload["total_bytes"] == 32029 + + # test a failure + event_bus.events = [] # reset our accumulator + queue.download(source=AnyHttpUrl("http://www.civitai.com/models/broken"), dest=tmp_path) + queue.join() + events = event_bus.events + print("\n".join([x.model_dump_json() for x in events])) + assert len(events) == 1 + assert events[0].event_name == "download_error" + assert events[0].payload["error_type"] == "HTTPError(NOT FOUND)" + assert events[0].payload["error"] is not None + assert re.search(r"requests.exceptions.HTTPError: NOT FOUND", events[0].payload["error"]) + queue.stop() + + +def test_broken_callbacks(tmp_path: Path, session: requests.sessions.Session, capsys) -> None: + queue = DownloadQueueService( + requests_session=session, + ) + queue.start() + + callback_ran = False + + def broken_callback(job: DownloadJob) -> None: + nonlocal callback_ran + callback_ran = True + print(1 / 0) # deliberate error here + + job = queue.download( + source=AnyHttpUrl("http://www.civitai.com/models/12345"), + dest=tmp_path, + on_progress=broken_callback, + ) + + queue.join() + assert job.status == DownloadJobStatus.COMPLETED # should complete even though the callback is borked + assert Path(tmp_path, "mock12345.safetensors").exists() + assert callback_ran + # LS: The pytest capsys fixture does not seem to be working. I can see the + # correct stderr message in the pytest log, but it is not appearing in + # capsys.readouterr(). + # captured = capsys.readouterr() + # assert re.search("division by zero", captured.err) + queue.stop() + + +def test_cancel(tmp_path: Path, session: requests.sessions.Session) -> None: + event_bus = DummyEventService() + + queue = DownloadQueueService(requests_session=session, event_bus=event_bus) + queue.start() + + cancelled = False + + def slow_callback(job: DownloadJob) -> None: + time.sleep(2) + + def cancelled_callback(job: DownloadJob) -> None: + nonlocal cancelled + cancelled = True + + job = queue.download( + source=AnyHttpUrl("http://www.civitai.com/models/12345"), + dest=tmp_path, + on_start=slow_callback, + on_cancelled=cancelled_callback, + ) + queue.cancel_job(job) + queue.join() + + assert job.status == DownloadJobStatus.CANCELLED + assert cancelled + events = event_bus.events + assert events[-1].event_name == "download_cancelled" + assert events[-1].payload["source"] == "http://www.civitai.com/models/12345" + queue.stop() diff --git a/tests/app/services/model_install/test_model_install.py b/tests/app/services/model_install/test_model_install.py index 310bcfa0c1..9010f9f296 100644 --- a/tests/app/services/model_install/test_model_install.py +++ b/tests/app/services/model_install/test_model_install.py @@ -48,11 +48,13 @@ def store( @pytest.fixture def installer(app_config: InvokeAIAppConfig, store: ModelRecordServiceBase) -> ModelInstallServiceBase: - return ModelInstallService( + installer = ModelInstallService( app_config=app_config, record_store=store, event_bus=DummyEventService(), ) + installer.start() + return installer class DummyEvent(BaseModel):