Spaces:
Running
on
Zero
Running
on
Zero
add : lora weights
Browse files
app.py
CHANGED
@@ -21,10 +21,10 @@ good_vae = AutoencoderKL.from_pretrained("black-forest-labs/FLUX.1-dev", subfold
|
|
21 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=dtype, vae=taef1).to(device)
|
22 |
|
23 |
# PONIX mode load
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
torch.cuda.empty_cache()
|
30 |
|
|
|
21 |
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=dtype, vae=taef1).to(device)
|
22 |
|
23 |
# PONIX mode load
|
24 |
+
pipe.load_lora_weights('cwhuh/ponix-generator-v0.1.0', weight_name='pytorch_lora_weights.safetensors')
|
25 |
+
embedding_path = hf_hub_download(repo_id='cwhuh/ponix-generator-v0.1.0', filename='./ponix-generator-v0.1.0_emb.safetensors', repo_type="model")
|
26 |
+
state_dict = load_file(embedding_path)
|
27 |
+
pipe.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>", "<s2>"], text_encoder=pipe.text_encoder, tokenizer=pipe.tokenizer)
|
28 |
|
29 |
torch.cuda.empty_cache()
|
30 |
|