Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def infer(
|
|
51 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
52 |
generator = torch.Generator("cuda").manual_seed(seed)
|
53 |
|
54 |
-
# 使用 get_weighted_text_embeddings_sdxl
|
55 |
if use_negative_prompt and negative_prompt:
|
56 |
(
|
57 |
prompt_embeds,
|
@@ -62,7 +62,6 @@ def infer(
|
|
62 |
pipe,
|
63 |
prompt=prompt,
|
64 |
neg_prompt=negative_prompt,
|
65 |
-
device=pipe.device,
|
66 |
)
|
67 |
else:
|
68 |
(
|
@@ -73,7 +72,6 @@ def infer(
|
|
73 |
) = get_weighted_text_embeddings_sdxl(
|
74 |
pipe,
|
75 |
prompt=prompt,
|
76 |
-
device=pipe.device,
|
77 |
)
|
78 |
prompt_neg_embeds = None
|
79 |
negative_pooled_prompt_embeds = None
|
|
|
51 |
seed = int(randomize_seed_fn(seed, randomize_seed))
|
52 |
generator = torch.Generator("cuda").manual_seed(seed)
|
53 |
|
54 |
+
# 使用 get_weighted_text_embeddings_sdxl 获取文本嵌入,不传递 device 参数
|
55 |
if use_negative_prompt and negative_prompt:
|
56 |
(
|
57 |
prompt_embeds,
|
|
|
62 |
pipe,
|
63 |
prompt=prompt,
|
64 |
neg_prompt=negative_prompt,
|
|
|
65 |
)
|
66 |
else:
|
67 |
(
|
|
|
72 |
) = get_weighted_text_embeddings_sdxl(
|
73 |
pipe,
|
74 |
prompt=prompt,
|
|
|
75 |
)
|
76 |
prompt_neg_embeds = None
|
77 |
negative_pooled_prompt_embeds = None
|