TinyTerra / ComfyUI_tinyterraNodes

A selection of nodes for Stable Diffusion ComfyUI
GNU General Public License v3.0
421 stars 45 forks source link

Advanced XYPlot : Missing Resource Error #119

Closed caniyabanci76 closed 5 months ago

caniyabanci76 commented 5 months ago

I'm getting the following error when using Advanced XYPlot I have pillow 10.3.0 installed.

Traceback (most recent call last):
  File "/home/tlday/ai/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
  File "/home/tlday/ai/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI-0246/utils.py", line 381, in new_func
    res_value = old_func(*final_args, **kwargs)
  File "/home/tlday/ai/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 1835, in sample
    return process_xyPlot(sdxl_model, sdxl_clip, sdxl_samples, sdxl_vae, sdxl_seed, sdxl_positive, sdxl_negative, lora_name, lora_strength, lora_strength,
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 1771, in process_xyPlot
    plot_image, images, samples = plotter.xy_plot_process()
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 794, in xy_plot_process
    plot_image = self.plot_images()
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 644, in plot_images
    label_bg = self.create_label(img, self.x_labels[col_index], int(48 * img.width / 512))
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 551, in create_label
    font_size = self.adjust_font_size(text, initial_font_size, label_width)
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 664, in adjust_font_size
    font = self.get_font(initial_font_size)
  File "/home/tlday/ai/ComfyUI/custom_nodes/ComfyUI_tinyterraNodes/ttNpy/tinyterraNodes.py", line 515, in get_font
    return ImageFont.truetype(str(Path(ttNpaths.font_path)), font_size)
  File "/home/tlday/ai/ComfyUI/venv/lib/python3.10/site-packages/PIL/ImageFont.py", line 819, in truetype
    return freetype(font)
  File "/home/tlday/ai/ComfyUI/venv/lib/python3.10/site-packages/PIL/ImageFont.py", line 816, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/home/tlday/ai/ComfyUI/venv/lib/python3.10/site-packages/PIL/ImageFont.py", line 245, in __init__
    self.font = core.getfont(
OSError: cannot open resource
TinyTerra commented 5 months ago

Please update ttN and let me know if the issue still occurs :)

caniyabanci76 commented 5 months ago

It's all good now! thank you! 🙏🏻

TinyTerra commented 5 months ago

Awesome :)

caniyabanci76 commented 5 months ago

just one question : is there a way to adjust the font size for the labels? in the final plot image?

TinyTerra commented 5 months ago

Not manually currently, it adjusts automatically depending on the length of the label. I could potentially add a way to set the minimum text size, or just outright set the size..

caniyabanci76 commented 5 months ago

maybe i'm doing something wrong, but the text currently looks very small ComfyUI_temp_hhkgj_00001_

TinyTerra commented 5 months ago

That was a bug. my bad. This should be fixed in the latest push