This commit is contained in:
Dnak-jb 2026-04-08 03:24:24 +00:00 committed by GitHub
commit 22daf5f831
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,6 @@ from __future__ import annotations
import json
import os
import random
import uuid
from io import BytesIO
@ -390,7 +389,7 @@ class PreviewImage(_UIOutput):
def __init__(self, image: Image.Type, animated: bool = False, cls: type[ComfyNode] = None, **kwargs):
self.values = ImageSaveHelper.save_images(
image,
filename_prefix="ComfyUI_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for _ in range(5)),
filename_prefix="ComfyUI_temp_" + uuid.uuid4().hex[:5],
folder_type=FolderType.temp,
cls=cls,
compress_level=1,
@ -414,7 +413,7 @@ class PreviewAudio(_UIOutput):
def __init__(self, audio: dict, cls: type[ComfyNode] = None, **kwargs):
self.values = AudioSaveHelper.save_audio(
audio,
filename_prefix="ComfyUI_temp_" + "".join(random.choice("abcdefghijklmnopqrstuvwxyz") for _ in range(5)),
filename_prefix="ComfyUI_temp_" + uuid.uuid4().hex[:5],
folder_type=FolderType.temp,
cls=cls,
format="flac",

View File

@ -12,7 +12,7 @@ import inspect
import traceback
import math
import time
import random
import uuid
import logging
from PIL import Image, ImageOps, ImageSequence
@ -1685,7 +1685,7 @@ class PreviewImage(SaveImage):
def __init__(self):
self.output_dir = folder_paths.get_temp_directory()
self.type = "temp"
self.prefix_append = "_temp_" + ''.join(random.choice("abcdefghijklmnopqrstupvxyz") for x in range(5))
self.prefix_append = "_temp_" + uuid.uuid4().hex[:5]
self.compress_level = 1
SEARCH_ALIASES = ["preview", "preview image", "show image", "view image", "display image", "image viewer"]