The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Some small changes to Load/SaveLatent.
comfyanonymousa7375103b9c8
diff --git a/nodes.py b/nodes.pyindex a2c7713aa..7255621d7 100644--- a/nodes.py+++ b/nodes.py@@ -11,6 +11,7 @@ import timefrom PIL import Imagefrom PIL.PngImagePlugin import PngInfoimport numpy as np+import safetensors.torchsys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))@@ -29,7 +30,6 @@ import importlibimport folder_paths-import safetensors.torch as sftdef before_node_execution():comfy.model_management.throw_exception_if_processing_interrupted()@@ -307,7 +307,10 @@ class SaveLatent:file = f"{filename}_{counter:05}_.latent"file = os.path.join(full_output_folder, file)- sft.save_file(samples, file, metadata=metadata)+ output = {}+ output["latent_tensor"] = samples["samples"]++ safetensors.torch.save_file(output, file, metadata=metadata)return {}@@ -328,9 +331,10 @@ class LoadLatent:def load(self, latent):file = folder_paths.get_annotated_filepath(latent, self.input_dir)- latent = sft.load_file(file, device="cpu")+ latent = safetensors.torch.load_file(file, device="cpu")+ samples = {"samples": latent["latent_tensor"]}- return (latent, )+ return (samples, )class CheckpointLoader: