Spaces:
Sleeping
Sleeping
Commit
·
165cd0f
1
Parent(s):
2a37641
update
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ m1_model_path = 'JingyeChen22/textdiffuser2_layout_planner'
|
|
59 |
|
60 |
m1_tokenizer = AutoTokenizer.from_pretrained(m1_model_path, use_fast=False)
|
61 |
m1_model = AutoModelForCausalLM.from_pretrained(
|
62 |
-
m1_model_path,
|
63 |
).cuda()
|
64 |
|
65 |
#### import diffusion models
|
@@ -90,13 +90,13 @@ unet = UNet2DConditionModel.from_pretrained(
|
|
90 |
text_encoder.resize_token_embeddings(len(tokenizer))
|
91 |
|
92 |
|
93 |
-
#### load lcm components
|
94 |
-
model_id = "lambdalabs/sd-pokemon-diffusers"
|
95 |
-
lcm_lora_id = "latent-consistency/lcm-lora-sdv1-5"
|
96 |
-
pipe = DiffusionPipeline.from_pretrained(model_id, unet=unet, tokenizer=tokenizer, text_encoder=text_encoder
|
97 |
-
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
98 |
-
pipe.load_lora_weights(lcm_lora_id)
|
99 |
-
pipe.to(device="cuda")
|
100 |
|
101 |
|
102 |
#### for interactive
|
|
|
59 |
|
60 |
m1_tokenizer = AutoTokenizer.from_pretrained(m1_model_path, use_fast=False)
|
61 |
m1_model = AutoModelForCausalLM.from_pretrained(
|
62 |
+
m1_model_path, low_cpu_mem_usage=True
|
63 |
).cuda()
|
64 |
|
65 |
#### import diffusion models
|
|
|
90 |
text_encoder.resize_token_embeddings(len(tokenizer))
|
91 |
|
92 |
|
93 |
+
# #### load lcm components
|
94 |
+
# model_id = "lambdalabs/sd-pokemon-diffusers"
|
95 |
+
# lcm_lora_id = "latent-consistency/lcm-lora-sdv1-5"
|
96 |
+
# pipe = DiffusionPipeline.from_pretrained(model_id, unet=unet, tokenizer=tokenizer, text_encoder=text_encoder)
|
97 |
+
# pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
98 |
+
# pipe.load_lora_weights(lcm_lora_id)
|
99 |
+
# pipe.to(device="cuda")
|
100 |
|
101 |
|
102 |
#### for interactive
|