From 06975653ae98144ddf6aa32c0159a45df8908b10 Mon Sep 17 00:00:00 2001 From: ryanontheinside Date: Thu, 13 Mar 2025 18:06:51 -0400 Subject: [PATCH] add batched denoising workflow --- .../sd15-tensorrt-batched-denoising.json | 376 ++++++++++++++++++ 1 file changed, 376 insertions(+) create mode 100644 examples/workflows/sd15-tensorrt-batched-denoising.json diff --git a/examples/workflows/sd15-tensorrt-batched-denoising.json b/examples/workflows/sd15-tensorrt-batched-denoising.json new file mode 100644 index 0000000..c182810 --- /dev/null +++ b/examples/workflows/sd15-tensorrt-batched-denoising.json @@ -0,0 +1,376 @@ +{ + "2": { + "inputs": { + "engine": "depth_anything_vitl14-fp16.engine", + "images": [ + "26", + 0 + ] + }, + "class_type": "DepthAnythingTensorrt", + "_meta": { + "title": "Depth Anything Tensorrt" + } + }, + "3": { + "inputs": { + "unet_name": "static-dreamshaper8_SD15_$stat-b-1-h-512-w-512_00001_.engine", + "model_type": "SD15" + }, + "class_type": "TensorRTLoader", + "_meta": { + "title": "TensorRT Loader" + } + }, + "5": { + "inputs": { + "text": "beautiful pencil sketch, masterpiece ", + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "6": { + "inputs": { + "text": "", + "clip": [ + "18", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "8": { + "inputs": { + "control_net_name": "control_v11f1p_sd15_depth_fp16.safetensors" + }, + "class_type": "ControlNetLoader", + "_meta": { + "title": "Load ControlNet Model" + } + }, + "9": { + "inputs": { + "strength": 0.9, + "start_percent": 0, + "end_percent": 1, + "positive": [ + "5", + 0 + ], + "negative": [ + "6", + 0 + ], + "control_net": [ + "10", + 0 + ], + "image": [ + "2", + 0 + ] + }, + "class_type": "ControlNetApplyAdvanced", + "_meta": { + "title": "Apply ControlNet" + } + }, + "10": { + "inputs": { + "backend": "inductor", + "fullgraph": false, + "mode": "reduce-overhead", + "controlnet": [ + "8", + 0 + ] + }, + "class_type": "TorchCompileLoadControlNet", + "_meta": { + "title": "TorchCompileLoadControlNet" + } + }, + "11": { + "inputs": { + "vae_name": "taesd" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "13": { + "inputs": { + "backend": "inductor", + "fullgraph": true, + "mode": "reduce-overhead", + "compile_encoder": true, + "compile_decoder": true, + "vae": [ + "11", + 0 + ] + }, + "class_type": "TorchCompileLoadVAE", + "_meta": { + "title": "TorchCompileLoadVAE" + } + }, + "14": { + "inputs": { + "samples": [ + "42", + 0 + ], + "vae": [ + "13", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "15": { + "inputs": { + "images": [ + "14", + 0 + ] + }, + "class_type": "PreviewImage", + "_meta": { + "title": "Preview Image" + } + }, + "16": { + "inputs": { + "width": 512, + "height": 512, + "batch_size": 1 + }, + "class_type": "EmptyLatentImage", + "_meta": { + "title": "Empty Latent Image" + } + }, + "18": { + "inputs": { + "stop_at_clip_layer": -2, + "clip": [ + "36", + 0 + ] + }, + "class_type": "CLIPSetLastLayer", + "_meta": { + "title": "CLIP Set Last Layer" + } + }, + "19": { + "inputs": { + "strength": 0.9, + "start_percent": 0, + "end_percent": 1, + "positive": [ + "5", + 0 + ], + "negative": [ + "6", + 0 + ], + "control_net": [ + "21", + 0 + ], + "image": [ + "39", + 1 + ] + }, + "class_type": "ControlNetApplyAdvanced", + "_meta": { + "title": "Apply ControlNet" + } + }, + "20": { + "inputs": { + "control_net_name": "control_v2p_sd15_mediapipe_face.safetensors" + }, + "class_type": "ControlNetLoader", + "_meta": { + "title": "Load ControlNet Model" + } + }, + "21": { + "inputs": { + "backend": "inductor", + "fullgraph": false, + "mode": "reduce-overhead", + "controlnet": [ + "20", + 0 + ] + }, + "class_type": "TorchCompileLoadControlNet", + "_meta": { + "title": "TorchCompileLoadControlNet" + } + }, + "26": { + "inputs": { + "image": "example.png", + "upload": "image" + }, + "class_type": "LoadImage", + "_meta": { + "title": "Load Image" + } + }, + "36": { + "inputs": { + "clip_name": "CLIPText/model.fp16.safetensors", + "type": "stable_diffusion", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "37": { + "inputs": { + "conditioning_to": [ + "9", + 1 + ], + "conditioning_from": [ + "19", + 1 + ] + }, + "class_type": "ConditioningConcat", + "_meta": { + "title": "Conditioning (Concat)" + } + }, + "38": { + "inputs": { + "conditioning_to": [ + "9", + 0 + ], + "conditioning_from": [ + "19", + 0 + ] + }, + "class_type": "ConditioningConcat", + "_meta": { + "title": "Conditioning (Concat)" + } + }, + "39": { + "inputs": { + "static_image_mode": false, + "max_num_faces": 1, + "refine_landmarks": false, + "min_detection_confidence": 0.35000000000000003, + "min_tracking_confidence": 0.35000000000000003, + "draw_mesh": true, + "draw_contours": true, + "mesh_color": "green", + "mesh_thickness": 2, + "image": [ + "26", + 0 + ] + }, + "class_type": "FaceMeshNode", + "_meta": { + "title": "Face Mesh" + } + }, + "41": { + "inputs": { + "num_steps": 3 + }, + "class_type": "StreamBatchSampler", + "_meta": { + "title": "Stream Batch Sampler" + } + }, + "42": { + "inputs": { + "add_noise": true, + "noise_seed": 977567268563782, + "cfg": 1, + "model": [ + "3", + 0 + ], + "positive": [ + "38", + 0 + ], + "negative": [ + "37", + 0 + ], + "sampler": [ + "41", + 0 + ], + "sigmas": [ + "44", + 0 + ], + "latent_image": [ + "43", + 0 + ] + }, + "class_type": "SamplerCustom", + "_meta": { + "title": "SamplerCustom" + } + }, + "43": { + "inputs": { + "buffer_size": 3, + "latent": [ + "16", + 0 + ] + }, + "class_type": "StreamFrameBuffer", + "_meta": { + "title": "Stream Frame Buffer" + } + }, + "44": { + "inputs": { + "t_index_list": "0,16,32", + "num_inference_steps": 50, + "model": [ + "3", + 0 + ] + }, + "class_type": "StreamScheduler", + "_meta": { + "title": "Stream Scheduler" + } + } +} \ No newline at end of file