Open Lex-DRL opened 1 month ago
I have the same problem as you, have you solved it?
Nope. That's why I've opened this issue. It doesn't look like it could be solved on a user side - since it appeared on a clean ComfyUI install. Probably, it's a bug that needs fixing.
ComfyUI works as usual, but this error is spammed really annoyingly.
Same error on NixOS. The current solution seems to be to manually adjust the path in the variable font_dir
(file ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes/nodes/nodes_graphics_text.py
)
elif platform.system() == "Linux":
font_dir = "/usr/share/fonts/truetype"
I like the suggestion to use the fc-list
command quite well. This also lists all available fonts under NixOS.
Unfortunately, even with Merge Request #124 systems are not taken into account where the path /usr/share/fonts
does not even exist.
I also tried creating a symlink to /usr/share/fonts/truetype
in my system configuration. But apart from the fact that this is a bit messy and hacky, the subsequent call to os.listdir(…)
does not follow any symlinks and results in the same error.
systemd = {
tmpfiles.rules = [
# Symlink not followed, still a ComfyUI Error in `CR Select Font`: No such file or directory: '/usr/share/fonts/truetype'
"L+ /usr/share/fonts/truetype - - - - ${pkgs.liberation_ttf}/share/fonts/truetype"
];
};
My current and hopefully only temporary workaround on NixOS is to create a folder /run/current-system/sw/share/X11/fonts
using the fonts.fontDir
option.
fonts.fontDir.enable = true;
Then adjust the variable font_dir
in the file ComfyUI/custom_nodes/ComfyUI_Comfyroll_CustomNodes/nodes/nodes_graphics_text.py
.
elif platform.system() == "Linux":
font_dir = "/run/current-system/sw/share/X11/fonts"
At least I found a solution on NixOS if you use a FHS environment (buildFHSUserEnv
).
Simply add a package with a TrueType font such as liberation_ttf
to the available packages (targetPkgs
), which will then provide the path /usr/share/fonts/truetype
in that environment with said font.
The error message from the title is thrown when I start ComfyUI under Linux (Manjaro).