Skip to content

Commit 51fcd62

Browse files
committed
only force clip on cpu ifd t5 is actually used
1 parent 8ed3074 commit 51fcd62

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
@@ -329,8 +329,12 @@ class StableDiffusionGGML {
329329
clip_backend = backend;
330330
bool use_t5xxl = false;
331331
if (sd_version_is_dit(version)) {
332-
// TODO: check if t5 is actually loaded?
333-
use_t5xxl = true;
332+
for (auto pair : model_loader.tensor_storages_types) {
333+
if (pair.first.find("text_encoders.t5xxl") != std::string::npos) {
334+
use_t5xxl = true;
335+
break;
336+
}
337+
}
334338
}
335339
if (!ggml_backend_is_cpu(backend) && use_t5xxl && conditioner_wtype != GGML_TYPE_F32) {
336340
clip_on_cpu = true;

0 commit comments

Comments
 (0)