ostris / ai-toolkit

Various AI scripts. Mostly Stable Diffusion stuff.
MIT License
220 stars 25 forks source link

Issue with sliders, comma separated #8

Closed Tyranomaster closed 10 months ago

Tyranomaster commented 10 months ago

Comma separated positive and negative options result in the following error on windows while trying to generate a slider. Removing the commas allows the generator to move forward and create a slider lora.

Prompt tensors not found. Encoding prompts.. Error running job: 'NoneType' object has no attribute 'text_embeds'

Traceback (most recent call last): File "E:\ai-toolkit-main\ai-toolkit\run.py", line 75, in main() File "E:\ai-toolkit-main\ai-toolkit\run.py", line 71, in main raise e File "E:\ai-toolkit-main\ai-toolkit\run.py", line 63, in main job.run() File "E:\ai-toolkit-main\ai-toolkit\jobs\TrainJob.py", line 50, in run process.run() File "E:\ai-toolkit-main\ai-toolkit\jobs\process\BaseSDTrainProcess.py", line 344, in run self.hook_before_train_loop() File "E:\ai-toolkit-main\ai-toolkit\jobs\process\TrainSliderProcess.py", line 114, in hook_before_train_loop concat_prompt_pair_batch = concat_prompt_pairs(prompt_pair_batch).to('cpu') File "E:\ai-toolkit-main\ai-toolkit\toolkit\prompt_utils.py", line 88, in concat_prompt_pairs positive_target = concat_prompt_embeds([p.positive_target for p in prompt_pairs]) File "E:\ai-toolkit-main\ai-toolkit\toolkit\prompt_utils.py", line 77, in concat_prompt_embeds text_embeds = torch.cat([p.text_embeds for p in prompt_embeds], dim=0) File "E:\ai-toolkit-main\ai-toolkit\toolkit\prompt_utils.py", line 77, in text_embeds = torch.cat([p.text_embeds for p in prompt_embeds], dim=0) AttributeError: 'NoneType' object has no attribute 'text_embeds'

jaretburkett commented 10 months ago

@Tyranomaster were you training SD1.5, or XL?

Tyranomaster commented 10 months ago

SD1.5

The example prompt gives this issue as well.

Tyranomaster commented 10 months ago

Looking into it some, it looks like it might be a diffusers issue, there is an open bug for it. I now get a different error on the example, which matches their error. I'm continuing to look into it, and I'll update you if I find an answer (it could easily be an issue with my install). (Edit: The new error is because I forgot to go into the VENV, and was using an old diffusers on my local install.)

jaretburkett commented 10 months ago

I am able to reproduce now on my windows machine. Looking into it.

jaretburkett commented 10 months ago

Should be fixed with https://github.com/ostris/ai-toolkit/commit/aeaca13d69225a634ea9bb2c79f5a8a9b087bd3d . Thank you for the details and your help. Let me know if you run into any more issues.

Tyranomaster commented 10 months ago

Fixed for me now! Thanks!