Skip to content

fix: resolve device mismatch in T5TextEmbedder #68

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mr-asa
Copy link

@mr-asa mr-asa commented Dec 19, 2024

Description

Fix device mismatch error in T5TextEmbedder class that was causing "Expected all tensors to be on the same device" error.

Changes

  • Add explicit device management for tensors and model
  • Fix CUDA/CPU device mismatch error in forward pass
  • Improve tensor device handling reliability

Problem

The T5TextEmbedder class was experiencing device mismatch errors when tensors were inadvertently placed on different devices (CUDA and CPU).

Solution

Modified the T5TextEmbedder class to ensure all tensors and the model are explicitly moved to the correct device before operations.

@iwr-redmond
Copy link

Hello @mr-asa. Thank you for your excellent PR.

In the absence of @JettHu and colleagues, you may wish to rename your fork (e.g. "comfyui_jankella") and publish it to the ComfyUI Registry so that everyone in the community can benefit from this essential update.

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

Successfully merging this pull request may close these issues.

2 participants