Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix regular empty latent image not working with SD3 and custom sampler.

comfyanonymous0eaa34ec5b22
diff --git a/comfy_extras/nodes_custom_sampler.py b/comfy_extras/nodes_custom_sampler.py
index 45ef8cf40..69f1b9418 100644
--- a/comfy_extras/nodes_custom_sampler.py
+++ b/comfy_extras/nodes_custom_sampler.py
@@ -380,7 +380,10 @@ class SamplerCustom:
def sample(self, model, add_noise, noise_seed, cfg, positive, negative, sampler, sigmas, latent_image):
latent = latent_image
latent_image = latent["samples"]
+ latent = latent.copy()
latent_image = comfy.sample.fix_empty_latent_channels(model, latent_image)
+ latent["samples"] = latent_image
+
if not add_noise:
noise = Noise_EmptyNoise().generate_noise(latent)
else:
@@ -539,7 +542,9 @@ class SamplerCustomAdvanced:
def sample(self, noise, guider, sampler, sigmas, latent_image):
latent = latent_image
latent_image = latent["samples"]
+ latent = latent.copy()
latent_image = comfy.sample.fix_empty_latent_channels(guider.model_patcher, latent_image)
+ latent["samples"] = latent_image
noise_mask = None
if "noise_mask" in latent: