Skip to content

Commit 29a8b51

Browse files
authored
fix: use torch device class instead of string for compatibility with comfy memory management (#200)
1 parent 26a5eaf commit 29a8b51

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nodes/models/flux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def load_model(
272272
data_type: str,
273273
**kwargs,
274274
) -> tuple[FluxTransformer2DModel]:
275-
device = f"cuda:{device_id}"
275+
device = torch.device(f"cuda:{device_id}")
276276
prefixes = folder_paths.folder_names_and_paths["diffusion_models"][0]
277277
for prefix in prefixes:
278278
if os.path.exists(os.path.join(prefix, model_path)):

0 commit comments

Comments
 (0)