How do you load multiple concepts and tokens at once?
As the title says, how can this be achieved? Is this possible? Like if you name each bin as the concept name, would the tokenizer and text encoder accept all the concepts in the embeds path, as well as take all the tokens? Does anyone have an example? I’m thinking it’d be cool to just an option to load the HF concepts library at once, and then to try and out stuff, or in combination, use their tokens.
2022-10-09T10:27:21Z
This is possible, but not done automatically. In thetextual inversion inference notebookthere’s code to loadoneof the trained embeddings. Essentially, repeating the process you could download several trained concepts at once and use them all in a single prompt.
2022-10-10T16:41:42Z
That’s sorta what I figured, but wasn’t entirely sure. It looked like the names for the methods actually expected multiple embeds to be loaded, not just one.Another question. In that notebook, it has a hidden example for loading a manual embed from URL. But when I do this, I get a invalid v error. Is this feature currently broken? It seems to be related to manually adding the token for the downloaded embed instead of using token file.Screenshot_61064×498 114 KB
2022-10-10T17:49:55Z
I think that cell should work if you put an URL to a embeddings file inembeds_urland leave the other one empty. For example, you can try this URL:https://huggingface.co/sd-concepts-library/alf/resolve/main/learned_embeds.binthat I took from the “Files” tab of the corresponding concept trained by a community memberhere.The downside is that you need to know the token that was used for training. You can easily print it in the notebook by adding a lineprint(trained_token)as the last line of the function in the next cell, as shown here:Screen Shot 2022-10-10 at 19.47.571372×1024 164 KB
2023-02-21T11:47:42Z
Hi there, I am using two embeddings I trained (one for object, one for style). I loaded these two embeddings but the generated image only has the object, style is completely lost.
2023-03-11T06:41:41Z
Hi, Is there any update how to load multiple concepts? can someone provide code examples?From here:diffusers/examples/textual_inversion at main · huggingface/diffusers · GitHubI trained one concept and one style/ two concepts, but from the example in below, how do i load once concept and one style or multiple concepts  in a single prompt because load pre-trained model_id is different, how to merge? if anyone know, can pls help? thanks a lot.from diffusers import StableDiffusionPipelinemodel_id = “path-to-your-trained-model”pipe = StableDiffusionPipeline.from_pretrained(model_id,torch_dtype=torch.float16).to(“cuda”)prompt = “A  backpack”image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]image.save(“cat-backpack.png”)
2023-03-11T06:44:10Z
Hi, did you solve this problem you mentioned? if solved, can pls share? thanks
2023-03-11T06:45:08Z
Hello,  did you solve this problem you mentioned? if solved, can pls share? thanks
2023-03-11T17:18:01Z
Since you are using textual embedding, you just need to load the basic SD model and your trained embeddings. My problem is that my embeddings are under-trained.
2023-03-11T17:44:42Z
Thanks! I was reading the code again last night and I think I understand you said. Let me find time to try today. Then follow up if any questions. Thanks!
2023-03-12T01:25:13Z
Thanks, I tried and I think it works.
2023-03-29T09:58:19Z
Update:this PRis about to be merged and it will make this process easier. Take a look at this example by Patrick:https://github.com/huggingface/diffusers/pull/2009#issuecomment-1481017738