-
Notifications
You must be signed in to change notification settings - Fork 22
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
Error in sampling stage- possibly related to MPS backend #12
Comments
Does the error also occur without |
Yes, just checked. And I'm using the default text to image workflow in the repo, just loaded Dreamshaper as the checkpoint rather than the aw_painting checkpoint. |
I'll try to reproduce it on my mac. |
@JettHu Wait, I just remembered (forgot because I've had to do this so many times in different ComfyUI plugins)- I modified the plugin code in model.py (line 28): def forward(self, x: torch.Tensor, timestep_embedding: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
emb = self.linear(self.silu(timestep_embedding))
shift, scale = emb.view(len(x), 1, -1).chunk(2, dim=-1)
return self.norm(x.to(torch.float32)).to(torch.float16) * (1 + scale) + shift If I don't cast x to full and then back to half, I get a fatal error in the Apply_Ella stage:
Sorry I didn't mention that before, since it might be relevant. Other plugins have worked fine with that change. |
Also, here's my full workflow in case it helps:
|
I am having the same problem on DirectML |
This may be solved by |
@jwooldridge234 Thank you for sharing the environment and workflow. I didn’t reproduce it yesterday. I only have time to look at it during the working day. Besides have you tried |
@jwooldridge234 On my mac (Apple M1 Pro, 32GB RAM), the error "LayerNormKernelImpl" not implemented for 'Half' Additionally I found that The picture below shows: 1.15it/s with 5.31s/it(0.188it/s) without Unfortunately, the issue you asked at the beginning was not reproduced. |
@JettHu That solves the issue with the text encoder, and makes it a ton faster, thank you. I'm still getting that error related to the ksampler ("index 1 is out of bounds for dimension 0 with size 1"), unfortunately. It happens with all models and samplers I've tested. |
@MythicalChu Are you still seeing this issue when you add --fp32-text-enc? |
I think I found the problem you may encounter. Do you have a long prompt and is the condition input to KSampler coming from the |
Sadly, no- I'm using the T5 Text Encode into the Apply Ella node, and then taking the conditioning from there into the KSampler. Shortening the prompt (or deleting it altogether) makes no difference. |
@jwooldridge234 I have released a new version, you can try it and see if you still have this error. |
Perfect, solved my issue! Thanks! |
Sorry for the late answer. No problem anymore, using --fp32-text-enc. Haven't tried the latest updates though, but I bet it's great :) |
Getting this error:
Seems to be related to this function:
This happens while running the latest ComfyUI on MacOS with "python main.py --preview-method taesd" as the initialization command. Also fails when running in force-fp16 mode. Fails if the encoder is set to fp32 or fp16. Let me know if I can provide any other information. Thanks!
The text was updated successfully, but these errors were encountered: