Skip to content

Commit 250e60f

Browse files
committed
only force clip on cpu ifd t5 is actually used
1 parent c61cfec commit 250e60f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

stable-diffusion.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,12 @@ class StableDiffusionGGML {
326326
clip_backend = backend;
327327
bool use_t5xxl = false;
328328
if (sd_version_is_dit(version)) {
329-
// TODO: check if t5 is actually loaded?
330-
use_t5xxl = true;
329+
for (auto pair : model_loader.tensor_storages_types) {
330+
if (pair.first.find("text_encoders.t5xxl") != std::string::npos) {
331+
use_t5xxl = true;
332+
break;
333+
}
334+
}
331335
}
332336
if (!clip_on_cpu && !ggml_backend_is_cpu(backend) && use_t5xxl) {
333337
LOG_WARN(

0 commit comments

Comments
 (0)