Skip to content

Commit

Permalink
Add loading text inversion (huggingface#9130)
Browse files Browse the repository at this point in the history
  • Loading branch information
waylongo authored Aug 19, 2024
1 parent ba4348d commit 815d882
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/textual_inversion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ import torch
model_id = "path-to-your-trained-model"
pipe = StableDiffusionPipeline.from_pretrained(model_id,torch_dtype=torch.float16).to("cuda")

repo_id_embeds = "path-to-your-learned-embeds"
pipe.load_textual_inversion(repo_id_embeds)

prompt = "A <cat-toy> backpack"

image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
Expand Down

0 comments on commit 815d882

Please sign in to comment.