Update README.md
Browse files
README.md
CHANGED
@@ -68,14 +68,14 @@ pipeline.load_lora_weights('cookey39/teratera', weight_name='pytorch_lora_weight
|
|
68 |
embedding_path = hf_hub_download(repo_id='cookey39/teratera', filename='teratera_emb.safetensors', repo_type="model")
|
69 |
state_dict = load_file(embedding_path)
|
70 |
# load embeddings of text_encoder 1 (CLIP ViT-L/14)
|
71 |
-
|
72 |
# load embeddings of text_encoder 2 (CLIP ViT-G/14)
|
73 |
-
|
74 |
|
75 |
instance_token = "<s0><s1>"
|
76 |
prompt = f"a {instance_token}full-length phoor portrait,Vibrant, solo, 1girl, smile, long hair, hair between eyes, multicolored eyes, hooded jacket, open jacket, shirt, long sleeves, ribbon, best quality, perfect anatomy, highres, absurdres{instance_token} "
|
77 |
negative_prompt = "bad_prompt_version2, (worst quality, low quality:1.4), realistic, lip, nose, tooth, rouge, lipstick, eyeshadow, abs, muscular, rib, (depth of field, bokeh, blurry:1.4), greyscale"
|
78 |
-
image =
|
79 |
image.save("./save.png")
|
80 |
```
|
81 |
|
|
|
68 |
embedding_path = hf_hub_download(repo_id='cookey39/teratera', filename='teratera_emb.safetensors', repo_type="model")
|
69 |
state_dict = load_file(embedding_path)
|
70 |
# load embeddings of text_encoder 1 (CLIP ViT-L/14)
|
71 |
+
pipeline.load_textual_inversion(state_dict["clip_l"], token=["<s0>", "<s1>"], text_encoder=pipeline.text_encoder, tokenizer=pipeline.tokenizer)
|
72 |
# load embeddings of text_encoder 2 (CLIP ViT-G/14)
|
73 |
+
pipeline.load_textual_inversion(state_dict["clip_g"], token=["<s0>", "<s1>"], text_encoder=pipeline.text_encoder_2, tokenizer=pipeline.tokenizer_2)
|
74 |
|
75 |
instance_token = "<s0><s1>"
|
76 |
prompt = f"a {instance_token}full-length phoor portrait,Vibrant, solo, 1girl, smile, long hair, hair between eyes, multicolored eyes, hooded jacket, open jacket, shirt, long sleeves, ribbon, best quality, perfect anatomy, highres, absurdres{instance_token} "
|
77 |
negative_prompt = "bad_prompt_version2, (worst quality, low quality:1.4), realistic, lip, nose, tooth, rouge, lipstick, eyeshadow, abs, muscular, rib, (depth of field, bokeh, blurry:1.4), greyscale"
|
78 |
+
image = pipeline(prompt=prompt, negative_prompt = negative_prompt, num_inference_steps=100, cross_attention_kwargs={"scale": 1.0},width = 960, height=1280).images[0]
|
79 |
image.save("./save.png")
|
80 |
```
|
81 |
|