Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Option for blank prompts in SD3's triple encoder to create the same conditioning as when text encoder is absent, the same as the model was trained #3785

Closed
CodeExplode opened this issue Jun 19, 2024 · 2 comments

Comments

@CodeExplode
Copy link

CodeExplode commented Jun 19, 2024

When SD3 is missing a text encoder, zeroes are passed instead. This seems to be how dropout was done during training, given the zeroing node of SD3's workflow. If T5 is absent, the prompt is not padded out for 77 zero tokens, rather just the first 77 CLIP token are passed (and vice versa).

I have also found that when finetuning with a particular conditioning (e.g. encoding blank prompts for the unconditional dropout, instead of zeroes), the model quickly adjusts to this, and then doesn't work with existing comfy workflows (e.g. zeroing). By the same logic, finetuning with only the CLIP models and no T5 would create a model which doesn't expect blank encoded T5 prompts as part of the conditioning, but rather requires the T5 to be handled as if it were completely absent.

Currently I load text encoders from the base SD3 checkpoint since there's no need to save them in my finetuning checkpoints if frozen, but that means there's no way to act as if T5 is missing as I train with. Having the option to zero each text encoder input (or rather, use the logic which comfy implements when it's absent altogether) would be more ideal.

edit: Sorry for the title changes, I somehow submitted the request while typing the description.

@CodeExplode CodeExplode changed the title [Feature Request] Option for blank prompts in SD3' triple encoder to create the same zero conditioning as when text encoder is absent [Feature Request] Option for blank prompts in SD3's triple encoder to create the same zero conditioning as when text encoder is absent Jun 19, 2024
@CodeExplode CodeExplode changed the title [Feature Request] Option for blank prompts in SD3's triple encoder to create the same zero conditioning as when text encoder is absent [Feature Request] Option for blank prompts in SD3's triple encoder to create the same conditioning as when text encoder is absent, the same as the model was trained Jun 19, 2024
@comfyanonymous
Copy link
Owner

that's what the "empty_padding: none" option should do in CLIPTextEncodeSD3.

@CodeExplode
Copy link
Author

Thanks you're correct, I saw that early on and didn't understand it at the time sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants