mirror of
https://github.com/Extraltodeus/test_my_prompt.git
synced 2026-11-05 00:17:26 +00:00
[GH-ISSUE #24] ModuleNotFoundError: No module named 'fonts' #18
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Extraltodeus/test_my_prompt#18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @arjohansen on GitHub (Aug 1, 2023).
Original GitHub issue: https://github.com/Extraltodeus/test_my_prompt/issues/24
I wasn't able to get this one to run, unfortunately.
On startup, the following error is printed:
A similar error appears when I try to install it in the scripts subfolder.
I'm not too familiar with stable-diffusion-webui internals, so I tried both adding
fontsto requirements.txt, and doing apip install fonts. Neither resolved it.Any tips appreciated!
Environment: version: v1.4.0 • python: 3.10.6 • torch: 2.0.1+cu118 • xformers: N/A • gradio: 3.32.0 • checkpoint: c52892e92a
@eugenioamato commented on GitHub (Aug 4, 2023):
I solved it by locally removing the font.
sorry I don't remember where I removed so I will share the whole file that I have in
stable-diffusion-webui\scripts\test_my_prompt_custom_script.py
I love this plugin! It works very well, thought,
remember that you are comparing results for 1 seed, so before removing prompts you should run the test multiple times.
@captainzero93 commented on GitHub (Aug 5, 2023):
^ Ubuntu Linux 22.04 LTS
e, False, 50) {}
Traceback (most recent call last):
File "D:\stable-diffusion-webui-1.4.0\modules\call_queue.py", line 58, in f
res = list(func(*args, **kwargs))
File "D:\stable-diffusion-webui-1.4.0\modules\call_queue.py", line 37, in f
res = func(*args, **kwargs)
File "D:\stable-diffusion-webui-1.4.0\modules\txt2img.py", line 59, in txt2img
processed = modules.scripts.scripts_txt2img.run(p, *args)
File "D:\stable-diffusion-webui-1.4.0\modules\scripts.py", line 501, in run
processed = script.run(p, *script_args)
File "D:\stable-diffusion-webui-1.4.0\scripts\testmypromptcustom.py", line 84, in run
if opts.samples_save:
NameError: name 'opts' is not defined
^ Windows 11
version: [1.5.1] • python: 3.10.9 • torch: 2.0.1+cu118 • xformers: 0.0.20 • gradio: 3.32.0
@colbygatte commented on GitHub (Aug 19, 2023):
@captainzero93 Looks like the script is missing the first line from the original script:
Adding this as the first line of @eugenioamato's script should fix the error for you 😊
@triviador commented on GitHub (Aug 21, 2023):
Fix for font error
line 4 from fonts.ttf import Roboto => from modules.paths_internal import roboto_ttf_file
line 38 font = ImageFont.truetype(Roboto, fontsize) => font = ImageFont.truetype(roboto_ttf_file, fontsize)
@eugenioamato In you code font size cant be changed
@captainzero93 commented on GitHub (Sep 21, 2023):
could this script / fix be merged for noobs