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.

harden: load training-dataset shards with weights_only=True (#14543)

Matt Miller94ee49b16128
diff --git a/comfy_extras/nodes_dataset.py b/comfy_extras/nodes_dataset.py
index 0253b4b4f..73fe75b7f 100644
--- a/comfy_extras/nodes_dataset.py
+++ b/comfy_extras/nodes_dataset.py
@@ -1583,7 +1583,7 @@ class LoadTrainingDataset(io.ComfyNode):
shard_path = os.path.join(dataset_dir, shard_file)
with open(shard_path, "rb") as f:
- shard_data = torch.load(f)
+ shard_data = torch.load(f, weights_only=True)
all_latents.extend(shard_data["latents"])
all_conditioning.extend(shard_data["conditioning"])