mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2025-12-31 17:53:35 +00:00
Compare commits
2 Commits
7a8ff2e819
...
3bae667f3d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bae667f3d | ||
|
|
8d0819c548 |
@ -459,8 +459,8 @@ struct FrozenCLIPEmbedderWithCustomWords : public Conditioner {
|
|||||||
if (sd_version_is_sdxl(version)) {
|
if (sd_version_is_sdxl(version)) {
|
||||||
text_model2->compute(n_threads,
|
text_model2->compute(n_threads,
|
||||||
input_ids2,
|
input_ids2,
|
||||||
0,
|
num_custom_embeddings,
|
||||||
NULL,
|
token_embed_custom.data(),
|
||||||
max_token_idx,
|
max_token_idx,
|
||||||
false,
|
false,
|
||||||
&chunk_hidden_states2, work_ctx);
|
&chunk_hidden_states2, work_ctx);
|
||||||
@ -470,8 +470,8 @@ struct FrozenCLIPEmbedderWithCustomWords : public Conditioner {
|
|||||||
if (chunk_idx == 0) {
|
if (chunk_idx == 0) {
|
||||||
text_model2->compute(n_threads,
|
text_model2->compute(n_threads,
|
||||||
input_ids2,
|
input_ids2,
|
||||||
0,
|
num_custom_embeddings,
|
||||||
NULL,
|
token_embed_custom.data(),
|
||||||
max_token_idx,
|
max_token_idx,
|
||||||
true,
|
true,
|
||||||
&pooled,
|
&pooled,
|
||||||
|
|||||||
@ -1841,6 +1841,7 @@ bool ModelLoader::load_tensors(on_new_tensor_cb_t on_new_tensor_cb, ggml_backend
|
|||||||
};
|
};
|
||||||
int tensor_count = 0;
|
int tensor_count = 0;
|
||||||
int64_t t1 = ggml_time_ms();
|
int64_t t1 = ggml_time_ms();
|
||||||
|
bool partial = false;
|
||||||
for (auto& tensor_storage : processed_tensor_storages) {
|
for (auto& tensor_storage : processed_tensor_storages) {
|
||||||
if (tensor_storage.file_index != file_index) {
|
if (tensor_storage.file_index != file_index) {
|
||||||
++tensor_count;
|
++tensor_count;
|
||||||
@ -1922,15 +1923,21 @@ bool ModelLoader::load_tensors(on_new_tensor_cb_t on_new_tensor_cb, ggml_backend
|
|||||||
ggml_backend_tensor_set(dst_tensor, convert_buffer.data(), 0, ggml_nbytes(dst_tensor));
|
ggml_backend_tensor_set(dst_tensor, convert_buffer.data(), 0, ggml_nbytes(dst_tensor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
size_t tensor_max = processed_tensor_storages.size();
|
||||||
int64_t t2 = ggml_time_ms();
|
int64_t t2 = ggml_time_ms();
|
||||||
pretty_progress(++tensor_count, processed_tensor_storages.size(), (t2 - t1) / 1000.0f);
|
pretty_progress(++tensor_count, tensor_max, (t2 - t1) / 1000.0f);
|
||||||
t1 = t2;
|
t1 = t2;
|
||||||
|
partial = tensor_count != tensor_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zip != NULL) {
|
if (zip != NULL) {
|
||||||
zip_close(zip);
|
zip_close(zip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (partial) {
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user