mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-28 15:20:25 +08:00
Update nodes.py
Add Datetime Filename Prefix
This commit is contained in:
parent
2eb7d06759
commit
a783775268
2
nodes.py
2
nodes.py
@ -6,6 +6,7 @@ import json
|
|||||||
import hashlib
|
import hashlib
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from PIL.PngImagePlugin import PngInfo
|
from PIL.PngImagePlugin import PngInfo
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -833,6 +834,7 @@ class SaveImage:
|
|||||||
def compute_vars(input):
|
def compute_vars(input):
|
||||||
input = input.replace("%width%", str(images[0].shape[1]))
|
input = input.replace("%width%", str(images[0].shape[1]))
|
||||||
input = input.replace("%height%", str(images[0].shape[0]))
|
input = input.replace("%height%", str(images[0].shape[0]))
|
||||||
|
input = input.replace("%date%", datetime.now().strftime("%Y%m%d%H%M%S"))
|
||||||
return input
|
return input
|
||||||
|
|
||||||
filename_prefix = compute_vars(filename_prefix)
|
filename_prefix = compute_vars(filename_prefix)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user