Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
ea30826
1
Parent(s):
3ac3698
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ pipe = AutoPipelineForText2Image.from_pretrained(
|
|
33 |
#)
|
34 |
#pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
35 |
|
36 |
-
|
37 |
#pipe.load_lora_weights(adapter_id)
|
38 |
#pipe.load_lora_weights(adapter_id_2)
|
39 |
#pipe.fuse_lora()
|
@@ -50,6 +50,7 @@ compel = Compel(tokenizer=[pipe.tokenizer, pipe.tokenizer_2] ,
|
|
50 |
text_encoder=[pipe.text_encoder, pipe.text_encoder_2],
|
51 |
returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED,
|
52 |
requires_pooled=[False, True])
|
|
|
53 |
|
54 |
def error_str(error, title="Error"):
|
55 |
return f"""#### {title}
|
@@ -113,7 +114,7 @@ def auto_prompt_correction(prompt_ui,neg_prompt_ui,disable_auto_prompt_correctio
|
|
113 |
#
|
114 |
def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
|
115 |
conditioning, pooled = compel([prompt, neg_prompt])
|
116 |
-
|
117 |
result = pipe(
|
118 |
prompt_embeds=conditioning[0:1],
|
119 |
pooled_prompt_embeds=pooled[0:1],
|
|
|
33 |
#)
|
34 |
#pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
35 |
|
36 |
+
|
37 |
#pipe.load_lora_weights(adapter_id)
|
38 |
#pipe.load_lora_weights(adapter_id_2)
|
39 |
#pipe.fuse_lora()
|
|
|
50 |
text_encoder=[pipe.text_encoder, pipe.text_encoder_2],
|
51 |
returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED,
|
52 |
requires_pooled=[False, True])
|
53 |
+
compel=compel.to("cuda")
|
54 |
|
55 |
def error_str(error, title="Error"):
|
56 |
return f"""#### {title}
|
|
|
114 |
#
|
115 |
def txt_to_img(prompt, neg_prompt, guidance, steps, width, height, generator):
|
116 |
conditioning, pooled = compel([prompt, neg_prompt])
|
117 |
+
pipe=pipe.to("cuda")
|
118 |
result = pipe(
|
119 |
prompt_embeds=conditioning[0:1],
|
120 |
pooled_prompt_embeds=pooled[0:1],
|