summaryrefslogtreecommitdiff
path: root/candle-examples/examples/stable-diffusion/attention.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-08-29 09:00:04 +0100
committerGitHub <noreply@github.com>2023-08-29 09:00:04 +0100
commit33c23c19b6f4821c00a47758f7841baf52ba9081 (patch)
tree71ad06837519d92a52d6a0021887bf1db4e29360 /candle-examples/examples/stable-diffusion/attention.rs
parent49326fb9252b67d1e46c69565da93106ee4b71a0 (diff)
downloadcandle-33c23c19b6f4821c00a47758f7841baf52ba9081.tar.gz
candle-33c23c19b6f4821c00a47758f7841baf52ba9081.tar.bz2
candle-33c23c19b6f4821c00a47758f7841baf52ba9081.zip
Preliminary support for SDXL. (#647)
* Preliminary support for SDXL. * More SDXL support. * More SDXL. * Use the proper clip config. * Querying for existing tensors. * More robust test.
Diffstat (limited to 'candle-examples/examples/stable-diffusion/attention.rs')
-rw-r--r--candle-examples/examples/stable-diffusion/attention.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/candle-examples/examples/stable-diffusion/attention.rs b/candle-examples/examples/stable-diffusion/attention.rs
index 58f5e87e..797542aa 100644
--- a/candle-examples/examples/stable-diffusion/attention.rs
+++ b/candle-examples/examples/stable-diffusion/attention.rs
@@ -473,7 +473,7 @@ impl AttentionBlock {
let num_heads = channels / num_head_channels;
let group_norm =
nn::group_norm(config.num_groups, channels, config.eps, vs.pp("group_norm"))?;
- let (q_path, k_path, v_path, out_path) = if vs.dtype() == DType::F16 {
+ let (q_path, k_path, v_path, out_path) = if vs.contains_tensor("to_q.weight") {
("to_q", "to_k", "to_v", "to_out.0")
} else {
("query", "key", "value", "proj_attn")