mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-02-03 02:00:29 +08:00
fix: only add timestamps to browser-previewed outputs
Reverted timestamp addition for non-previewed files: - SaveLatent (.latent) - not previewed in browser - CheckpointSave, CLIPSave, VAESave (.safetensors) - model files - ExtractAndSaveLoRA, SaveLoRA (.safetensors) - LoRA files Kept timestamps for browser-previewed content: - Images (PNG, SVG) - Videos (WebM, MP4) - Audio - 3D models (GLB) Amp-Thread-ID: https://ampcode.com/threads/T-019c1be0-7238-71ec-9c0b-2d4468d61202
This commit is contained in:
parent
6c2223ade9
commit
b6b420190c
@ -115,7 +115,7 @@ class LoraSave(io.ComfyNode):
|
||||
if text_encoder_diff is not None:
|
||||
output_sd = calc_lora_model(text_encoder_diff.patcher, rank, "", "text_encoders.", output_sd, lora_type, bias_diff=bias_diff)
|
||||
|
||||
output_checkpoint = folder_paths.format_output_filename(filename, counter, "safetensors")
|
||||
output_checkpoint = f"{filename}_{counter:05}_.safetensors"
|
||||
output_checkpoint = os.path.join(full_output_folder, output_checkpoint)
|
||||
|
||||
comfy.utils.save_torch_file(output_sd, output_checkpoint, metadata=None)
|
||||
|
||||
@ -221,7 +221,7 @@ def save_checkpoint(model, clip=None, vae=None, clip_vision=None, filename_prefi
|
||||
for x in extra_pnginfo:
|
||||
metadata[x] = json.dumps(extra_pnginfo[x])
|
||||
|
||||
output_checkpoint = folder_paths.format_output_filename(filename, counter, "safetensors")
|
||||
output_checkpoint = f"{filename}_{counter:05}_.safetensors"
|
||||
output_checkpoint = os.path.join(full_output_folder, output_checkpoint)
|
||||
|
||||
comfy.sd.save_checkpoint(output_checkpoint, model, clip, vae, clip_vision, metadata=metadata, extra_keys=extra_keys)
|
||||
@ -297,7 +297,7 @@ class CLIPSave:
|
||||
|
||||
full_output_folder, filename, counter, subfolder, filename_prefix_ = folder_paths.get_save_image_path(filename_prefix_, self.output_dir)
|
||||
|
||||
output_checkpoint = folder_paths.format_output_filename(filename, counter, "safetensors")
|
||||
output_checkpoint = f"{filename}_{counter:05}_.safetensors"
|
||||
output_checkpoint = os.path.join(full_output_folder, output_checkpoint)
|
||||
|
||||
current_clip_sd = comfy.utils.state_dict_prefix_replace(current_clip_sd, replace_prefix)
|
||||
@ -333,7 +333,7 @@ class VAESave:
|
||||
for x in extra_pnginfo:
|
||||
metadata[x] = json.dumps(extra_pnginfo[x])
|
||||
|
||||
output_checkpoint = folder_paths.format_output_filename(filename, counter, "safetensors")
|
||||
output_checkpoint = f"{filename}_{counter:05}_.safetensors"
|
||||
output_checkpoint = os.path.join(full_output_folder, output_checkpoint)
|
||||
|
||||
comfy.utils.save_torch_file(vae.get_sd(), output_checkpoint, metadata=metadata)
|
||||
|
||||
@ -1221,9 +1221,9 @@ class SaveLoRA(io.ComfyNode):
|
||||
folder_paths.get_save_image_path(prefix, output_dir)
|
||||
)
|
||||
if steps is None:
|
||||
output_checkpoint = folder_paths.format_output_filename(filename, counter, "safetensors")
|
||||
output_checkpoint = f"{filename}_{counter:05}_.safetensors"
|
||||
else:
|
||||
output_checkpoint = folder_paths.format_output_filename(f"{filename}_{steps}_steps", counter, "safetensors")
|
||||
output_checkpoint = f"{filename}_{steps}_steps_{counter:05}_.safetensors"
|
||||
output_checkpoint = os.path.join(full_output_folder, output_checkpoint)
|
||||
safetensors.torch.save_file(lora, output_checkpoint)
|
||||
return io.NodeOutput()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user