The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Make denoised output on custom sampler nodes work with nested tensors. (#11471)
comfyanonymous33aa808713f7
diff --git a/comfy_extras/nodes_custom_sampler.py b/comfy_extras/nodes_custom_sampler.pyindex 7ee4caac1..993889d9d 100644--- a/comfy_extras/nodes_custom_sampler.py+++ b/comfy_extras/nodes_custom_sampler.py@@ -760,8 +760,12 @@ class SamplerCustom(io.ComfyNode):out = latent.copy()out["samples"] = samplesif "x0" in x0_output:+ x0_out = model.model.process_latent_out(x0_output["x0"].cpu())+ if samples.is_nested:+ latent_shapes = [x.shape for x in samples.unbind()]+ x0_out = comfy.nested_tensor.NestedTensor(comfy.utils.unpack_latents(x0_out, latent_shapes))out_denoised = latent.copy()- out_denoised["samples"] = model.model.process_latent_out(x0_output["x0"].cpu())+ out_denoised["samples"] = x0_outelse:out_denoised = outreturn io.NodeOutput(out, out_denoised)@@ -948,8 +952,12 @@ class SamplerCustomAdvanced(io.ComfyNode):out = latent.copy()out["samples"] = samplesif "x0" in x0_output:+ x0_out = guider.model_patcher.model.process_latent_out(x0_output["x0"].cpu())+ if samples.is_nested:+ latent_shapes = [x.shape for x in samples.unbind()]+ x0_out = comfy.nested_tensor.NestedTensor(comfy.utils.unpack_latents(x0_out, latent_shapes))out_denoised = latent.copy()- out_denoised["samples"] = guider.model_patcher.model.process_latent_out(x0_output["x0"].cpu())+ out_denoised["samples"] = x0_outelse:out_denoised = outreturn io.NodeOutput(out, out_denoised)