ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

How to display other files images on web pages?

Open NO13Listener opened this issue 2 years ago • 1 comments

I add the files in output\Year-month-day, and it getting work, but how to display images on web pages???

nodes.py

import time

class SaveImage: def init(self): #加入含有日期的存储图片路径# today=time.strftime("%Y-%m-%d",time.localtime()) #今天日期

  ZZX ="\ComfyUI\output\{}".format(today) #想保存的路径名称
  if not os.path.exists(ZZX):   #如果不存在
    os.makedirs(ZZX)     #创建

  self.output_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "output\{}".format(today))

NO13Listener avatar Mar 23 '23 11:03 NO13Listener

Output stuff is really jank. We need to be able to output images from anywhere, and text as well. But right now it seems to be able to only display images from the output and input dir. No where else. My custom node won't display any image when saving to any custom folders.

WASasquatch avatar Mar 24 '23 05:03 WASasquatch

My friend and I expand this work and its ok, try to add and change these place enough: I think you can understand and I hope it can be helpful Change

NO13Listener avatar Mar 24 '23 21:03 NO13Listener

My friend and I expand this work and its ok, try to add and change these place enough: I think you can understand and I hope it can be helpful Change

Very nice, so in the example we get images sorted by the day, like in webui. This is an appreciated share, and informational on the flow. Thank you, to you and your friend.

WASasquatch avatar Mar 24 '23 23:03 WASasquatch