GeorgLegato / Txt2Vectorgraphics

Custom Script for Automatics1111 StableDiffusion-WebUI.
GNU General Public License v3.0
362 stars 29 forks source link

[ERROR]: AssertionError #20

Closed Woisek closed 1 year ago

Woisek commented 1 year ago

At the end of the generation process, this errors comes up:

100%|██████████████████████████████████████████████████████████████████████████████████| 35/35 [00:16<00:00, 2.17it/s] Loading CLiP model ViT-L/14 ███████████████████████████████████████████████████████████| 35/35 [00:12<00:00, 2.76it/s] Error completing request Arguments: ('task(y2dmqzow27hap8g)', 'futuristic minimalistic centered stylized logo of a bear, symmetrical, white with black background, smooth vector, tech company,(((lineart))),((low detail)),(simple),high contrast,sharp,2 bit,(((vector graphic))),medium detail', '(bad quality, worst quality, low quality:1.2) 3d, rendering, unreal, malformed, deformed', [], 35, 3, True, False, 1, 1, 7, 829816994.0, -1.0, 0, 0, 0, False, 543, 768, False, 0.7, 2, 'Latent', 0, 0, 0, [], 4, False, False, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'Refresh models', False, 'keyword prompt', 'random', 'None', 'textual inversion first', 'None', '0.7', 'None', True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, False, 'none', 'None', 1, None, False, 'Scale to Fit (Inner Fit)', False, False, 64, 64, 64, 0, 1, False, False, 'none', 'None', 1, None, False, 'Scale to Fit (Inner Fit)', False, False, 64, 64, 64, 0, 1, False, 0.9, 5, '0.0001', False, 'None', '', 0.1, False, False, 'Euler a', 0.95, 0.75, 'zero', 'pos', 'linear', 0.01, 0.0, 0.75, None, 'Lanczos', 1, 0, 0, None, '', 'outputs', False, False, 'positive', 'comma', 0, False, False, '', 'Illustration', 'svg', True, True, False, 0.5, False, 16, False, 16, 1, '', 0, '', 0, '', True, False, False, False, 0, 'Not set', True, True, '', '', '', '', '', 1.3, 'Not set', 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', False, 'None', None, True, None, None, False, None, None, 50, False, 4.0, '', 10.0, 'Linear', 3, False, True, 30.0, True, False, False, 0, 0.0, 'Lanczos', 1, True, 0, 0, 0, 512, 512, False, False, True, True, True, False, False, 1, False, False, 2.5, 4, 0, False, 0, 1, False, False, 'u2net', False, False, False, False) {} Traceback (most recent call last): File "I:\Super SD 2.0\stable-diffusion-webui\modules\call_queue.py", line 56, in f res = list(func(*args, *kwargs)) File "I:\Super SD 2.0\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(args, *kwargs) File "I:\Super SD 2.0\stable-diffusion-webui\modules\txt2img.py", line 53, in txt2img processed = modules.scripts.scripts_txt2img.run(p, args) File "I:\Super SD 2.0\stable-diffusion-webui\modules\scripts.py", line 376, in run processed = script.run(p, *script_args) File "I:\Super SD 2.0\stable-diffusion-webui\scripts\txt2vectorgfx.py", line 119, in run assert len(files) > 0 AssertionError

Used the last available script version. Any suggestions, please?

GeorgLegato commented 1 year ago

seems you are not storing output images to disk immediately. so the assert fails on "len(files)>0". check your SD-settings where and whether files are stored. image image

Woisek commented 1 year ago

I'm not sure if this is really the reason ...

pic1 pic2

GeorgLegato commented 1 year ago

your sd-installation is on other location than the outputs are stored. should not be a drama, but I havent tested this yet. you could try to store output images in the same folder, just "outputs/txt2img-images" (as in my example-screenshot).

are there really files in this folder (I:\stable_diffusion)... are there special file permissions? but if SD is able to write there, the script runs under same process/user and should own same write/read-permissions

GeorgLegato commented 1 year ago

please insert a line the following statement (using notepad or so):

print ("Debug TXT2Vector: Globbing folder: " + folder+"/*."+opts.samples_format)

at the same intent-level than the line before (using tab)

image

then check the console output after one rendering and the script active: image

Woisek commented 1 year ago

@GeorgLegato I changed the folder path, but it had no effect. I added the line of code and this is the output:

To create a public link, set share=True in launch(). Loading weights [21c6d51e3e] from I:\Super SD 2.0\stable-diffusion-webui\models\Stable-diffusion\Realistic Vision\realistic_vision_v1.4.safetensors Creating model from config: I:\Super SD 2.0\stable-diffusion-webui\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading VAE weights specified in settings: I:\Super SD 2.0\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors Applying xformers cross attention optimization. Model loaded in 2.8s (create model: 0.4s, apply weights to model: 0.8s, apply half(): 0.7s, load VAE: 0.1s, move model to device: 0.6s, load textual inversion embeddings: 0.2s). 100%|██████████████████████████████████████████████████████████████████████████████████| 35/35 [00:17<00:00, 2.00it/s] Loading CLiP model ViT-L/14 ███████████████████████████████████████████████████████████| 35/35 [00:14<00:00, 2.40it/s] Loading weights [c6bbc15e32] from I:\Super SD 2.0\stable-diffusion-webui\models\Stable-diffusion\SD v1.5\v1-5-inpainting.ckpt Creating model from config: I:\Super SD 2.0\stable-diffusion-webui\configs\v1-inpainting-inference.yaml LatentInpaintDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.54 M params. Loading VAE weights specified in settings: I:\Super SD 2.0\stable-diffusion-webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors Applying xformers cross attention optimization. Model loaded in 2.8s (create model: 0.4s, apply weights to model: 0.7s, apply half(): 0.7s, load VAE: 0.1s, move model to device: 0.6s, load textual inversion embeddings: 0.2s). Debug TXT2Vector: Globbing folder: I:\Super SD 2.0\stable-diffusion-webui\outputs\txt2img-images\A painting depicting Rome/.png Error completing request Arguments: ('task(b8wuiqf2sssayua)', 'futuristic minimalistic centered stylized logo of a wolf, symmetrical, white with black background, smooth vector, tech company, (lineart:1.3), (low detail:1.2), (simple:1.1), high contrast, sharp, 2 bit, (vector graphic:1.3), medium detail,(((lineart))),((low detail)),(simple),high contrast,sharp,2 bit,(((vector graphic))),medium detail,(((lineart))),((low detail)),(simple),high contrast,sharp,2 bit,(((vector graphic))),medium detail', '(bad quality, worst quality, low quality:1.2) 3d, rendering, unreal, malformed, deformed', [], 35, 3, True, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0, False, 543, 768, False, 0.7, 2, 'Latent', 0, 0, 0, ['Model hash: 21c6d51e3e'], 4, False, False, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'LoRA', 'None', 0, 0, 'Refresh models', False, 'keyword prompt', 'random', 'None', 'textual inversion first', 'None', '0.7', 'None', False, '', True, False, 1, False, False, False, 1.1, 1.5, 100, 0.7, False, False, True, False, False, 0, 'Gustavosta/MagicPrompt-Stable-Diffusion', '', False, False, 'none', 'None', 1, None, False, 'Scale to Fit (Inner Fit)', False, False, 64, 64, 64, 0, 1, False, False, 'none', 'None', 1, None, False, 'Scale to Fit (Inner Fit)', False, False, 64, 64, 64, 0, 1, False, 0.9, 5, '0.0001', False, 'None', '', 0.1, False, False, 'Euler a', 0.95, 0.75, 'zero', 'pos', 'linear', 0.01, 0.0, 0.75, None, 'Lanczos', 1, 0, 0, None, '', 'outputs', False, False, 'positive', 'comma', 0, False, False, '', 'Illustration', 'svg', True, True, False, 0.5, False, 16, False, 16, 1, '', 0, '', 0, '', True, False, False, False, 0, 'Not set', True, True, '', '', '', '', '', 1.3, 'Not set', 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', 1.3, 'Not set', False, 'None', None, True, None, None, False, None, None, 50, False, 4.0, '', 10.0, 'Linear', 3, False, True, 30.0, True, False, False, 0, 0.0, 'Lanczos', 1, True, 0, 0, 0, 512, 512, False, False, True, True, True, False, False, 1, False, False, 2.5, 4, 0, False, 0, 1, False, False, 'u2net', False, False, False, False) {} Traceback (most recent call last): File "I:\Super SD 2.0\stable-diffusion-webui\modules\call_queue.py", line 56, in f res = list(func(args, *kwargs)) File "I:\Super SD 2.0\stable-diffusion-webui\modules\call_queue.py", line 37, in f res = func(args, *kwargs) File "I:\Super SD 2.0\stable-diffusion-webui\modules\txt2img.py", line 53, in txt2img processed = modules.scripts.scripts_txt2img.run(p, args) File "I:\Super SD 2.0\stable-diffusion-webui\modules\scripts.py", line 376, in run processed = script.run(p, *script_args) File "I:\Super SD 2.0\stable-diffusion-webui\scripts\txt2vectorgfx.py", line 122, in run assert len(files) > 0 AssertionError

The image (PNG) was generated anyway.

GeorgLegato commented 1 year ago

ok, I see a problem already, your path contains whitespaces

Debug TXT2Vector: Globbing folder: I:\Super SD 2.0\stable-diffusion-webui\outputs\txt2img-images\A painting depicting Rome/*.png

The script need to quote such paths. to be fixed. actually I wonder, where the "A painting depicting Rome" comes from. is it part of the prompt? Or do you use some "subfolder"-storage? I get subfolder and images with stupid numbers (and no whitespaces, so i never encounter such prob) image

however, whitespaces have to be handled by the globber (scanning that folder)

GeorgLegato commented 1 year ago

Got the error reconstructed, but: it is a sporadic one, and does not apply to whitespaces at all. The image files are in that moment the script globbs the folder NOT YET present. Here is a race condition, maybe larger files take 1-2 seconds to get "officially" onto the filesystem, where the script is already scanning/globbing. Resolution: If no files found (where they are expected) wait 5 seconds and try again. then give up

Woisek commented 1 year ago

@GeorgLegato

actually I wonder, where the "A painting depicting Rome" comes from. is it part of the prompt? Or do you use some "subfolder"-storage?

This is not part of the actually used prompt, but an existing folder named after this prompt, resting besides the "test" folder, that I use to save the images. And I don't know why it's touching this folder. That's odd to do.

I get subfolder and images with stupid numbers (and no whitespaces, so i never encounter such prob)

I like to sort and order my generated images, so my basically path for generating is templated like this: test/[prompt_words]/[model_name]/ Therefore blank characters are very likely to arise.

GeorgLegato commented 1 year ago

no doubt, you keep your workflow, i fix it tonight.

Woisek commented 1 year ago

That's great! I also add, that when generating images, I never used the "enable vectorizing" option, if this is maybe important.

GeorgLegato commented 1 year ago

not enabling vectorising switches creation of svg off, so actually no sense, or you need png processing (quantising)