Embeddings in Stable Diffusion (locally)

AI Evangelist at Adobe
20 Oct 202231:02

TLDRThe video tutorial introduces the concept of embeddings in Stable Diffusion, focusing on local installation and usage. The creator shares their experience of training a model on personal portraits to generate neon-style images using embeddings. They guide viewers on how to create and train their own embeddings for personalized portrait generation, demonstrating the process with examples and providing tips for optimizing the results.


  • ๐ŸŒŸ Introduction to embeddings in Stable Diffusion, specifically for local installation and usage.
  • ๐Ÿ“Œ Explanation on how to use embeddings for creating art in a specific style not available in the base model.
  • ๐ŸŽจ Tutorial on creating a personal embedding library, like the 'Phoenix Library' mentioned.
  • ๐Ÿ–ผ๏ธ Demonstration of using embeddings to render portraits in a neon style, using the creator's own face as an example.
  • ๐Ÿ”— Importance of naming conventions for embeddings and how they are utilized in the process.
  • ๐Ÿ“ธ Discussion on the process of training an embedding using a collection of photographs in a desired style.
  • ๐Ÿ–Œ๏ธ Guide on how to preprocess images for training embeddings, including resizing and ensuring visibility of key features.
  • ๐Ÿ“ Instructions on creating a text document with descriptive captions for training embeddings effectively.
  • ๐Ÿ”„ Explanation of the training process, including selecting the number of vectors per token and choosing a learning rate.
  • ๐Ÿ” How to monitor the training process and save embeddings at specific intervals for future use.
  • ๐ŸŒˆ Showcase of the final results, emphasizing the successful creation of neon-style portraits through the trained embeddings.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is about embeddings in Stable Diffusion, specifically focusing on how to use and create embeddings locally.

  • What is Stable Diffusion?

    -Stable Diffusion is a type of AI model that can generate images from text prompts, and it can be installed and used locally on a computer or through platforms like Google Colab.

  • Why would someone want to create an embedding in Stable Diffusion?

    -Someone might want to create an embedding in Stable Diffusion to capture a specific style or aesthetic that they like, which may not be available in the default models, such as neon-looking portraits.

  • How does the speaker use their own face model in Stable Diffusion?

    -The speaker trained the Stable Diffusion model using photos of their own face, allowing them to render their face in various styles within the AI-generated images.

  • What is an example of an embedding the speaker created?

    -The speaker created an embedding library called 'Chris Style', which they used to generate neon portrait-style images of themselves.

  • How can users find and use embeddings online?

    -Users can find embeddings online by searching for them and using them in their text prompts in Stable Diffusion. The speaker also mentions building their own lamp library of embeddings.

  • What is the process for training an embedding in Stable Diffusion?

    -To train an embedding, one needs to collect images of the desired style, preprocess them to the required size, and then use the 'train' function in Stable Diffusion with the images and a descriptive prompt to create the embedding.

  • How does the speaker ensure their embeddings are saved and used correctly in Stable Diffusion?

    -The speaker saves the embeddings every 500 steps during training and ensures they are placed in the correct 'embeddings' folder within the Stable Diffusion directory, using appropriate naming conventions.

  • What is the significance of using brackets in text prompts?

    -Brackets are used in text prompts to increase the importance of a word or phrase for the Stable Diffusion model, thereby influencing the final generated image.

  • How does the speaker experiment with different embeddings and models?

    -The speaker experiments by generating images using different embeddings, playing with various prompts, and selecting models that best capture the desired style or aesthetic.

  • What advice does the speaker give for training embeddings?

    -The speaker advises to keep an eye on the training process, check the generated images regularly, and select the best ones for further use in Stable Diffusion.



๐ŸŽจ Introduction to Stable Diffusion and Embeddings

The speaker begins by introducing the topic of embeddings in stable diffusion, a technique used to incorporate specific styles or elements into images generated by stable diffusion. They mention the possibility of using Google Colab for those who do not have stable diffusion installed locally and reference a previous tutorial for training a model using personal photos. The speaker shares their interest in neon-looking portraits and how they have successfully rendered their own face in stable diffusion using a model they trained. They also introduce an embeddings library on their website, detailing how to train embeddings for creating personalized portraits in various styles.


๐Ÿ–Œ๏ธ Utilizing Embeddings for Custom Portraits

The speaker delves into the practical application of embeddings by demonstrating how to use them in stable diffusion to create custom portraits. They guide the audience through the process of selecting a model, using style embeddings, and crafting prompts to generate images. The speaker emphasizes the importance of using the correct embedding names and provides examples of self-portraits in a neon style. They also discuss the potential of finding and experimenting with different embeddings online and encourage sharing one's own creations.


๐ŸŒƒ Training Embeddings with Neon Portraits

The speaker shares their experience in training embeddings using neon portraits. They explain the process of downloading and preparing images for training, organizing them into folders, and using specific software to process the images. The speaker also discusses the importance of creating a compelling prompt that aligns with the desired style and provides an example of how to structure the prompt effectively. They further explore the concept of experimenting with different prompts and settings to achieve the desired outcome in stable diffusion.


๐Ÿ” Analyzing and Preprocessing Images for Embedding

In this section, the speaker focuses on the preprocessing of images for embedding training. They describe how to analyze and select the best images, create flipped copies, and manage oversized images. The speaker also explains how to use software to process the images and ensure they are cut nicely with visible faces. They discuss the importance of using specific file formats like PNG for training and how to organize these files into a folder for the next steps.


๐Ÿ“ Crafting Prompts and Training Embeddings

The speaker provides a detailed guide on crafting effective prompts for training embeddings in stable diffusion. They discuss the significance of choosing the right words and structuring the prompt to reflect the desired style. The speaker also explains how to use text documents to refine prompts and shares their thought process in creating a prompt. They then walk through the process of training an embedding using the prepared images and the created prompt, highlighting the importance of selecting the correct model and settings for the best results.


๐Ÿ–ผ๏ธ Evaluating and Applying the Trained Embeddings

The speaker presents the results of their embedding training and discusses how to evaluate the images generated during the process. They explain how to select the most effective embeddings and apply them to create new images in the desired style. The speaker also shares their excitement in seeing the training process in action and the satisfaction of achieving images that closely match the intended neon style. They encourage the audience to experiment with different embeddings and settings to find the best combination for their creative projects.




Embeddings in the context of the video refer to a technique used in machine learning and artificial intelligence, specifically in the domain of Stable Diffusion, to capture the style or essence of a particular set of images. They are a way to represent complex data in a more manageable form, allowing the AI to generate images that reflect certain characteristics or styles. In the video, embeddings are used to train the AI on specific styles, such as neon portraits, so that it can generate images in that style. The creator demonstrates how to use embeddings to personalize the AI's output, making it more relevant and meaningful to the user.

๐Ÿ’กStable Diffusion

Stable Diffusion is an AI model that generates images from textual descriptions. It is capable of creating detailed and diverse visual content based on the prompts given to it. In the video, the creator discusses using Stable Diffusion installed locally on a computer, as well as alternative methods like using Google Colab for those who do not have it installed. The video provides a tutorial on how to enhance the functionality of Stable Diffusion by training it with custom embeddings, thus personalizing the generated images to specific styles or aesthetics.

๐Ÿ’กNeon Portraits

Neon portraits refer to a specific photographic style characterized by the use of neon lights and vibrant colors, often creating a futuristic or cyberpunk aesthetic. In the video, the creator expresses a personal preference for this style and demonstrates how to train the Stable Diffusion model to generate portraits with a neon look. This involves creating an embedding that captures the essence of neon-style images, which can then be used as a reference for the AI to generate new images in the same vein.

๐Ÿ’กGoogle Colab

Google Colab is a cloud-based platform that allows users to run Python code in a collaborative environment, particularly useful for machine learning and data analysis tasks. In the video, it is mentioned as an alternative for users who do not have Stable Diffusion installed on their local machine. The creator provides a link to a specific helper tool on Google Colab that can be used to work with embeddings and Stable Diffusion in a web-based environment.


Chrisard.helpers appears to be a resource or a set of tools created by the video creator to assist users in working with Stable Diffusion and embeddings. It is mentioned as a place where users can find help with embedding sensible diffusion, suggesting that it may offer tutorials, guides, or scripts to facilitate the process of training the AI model with custom embeddings.


Self-portraits are images that an artist or photographer creates of themselves. In the context of the video, the creator has used Stable Diffusion to generate self-portraits by training the AI model on photos of their own face. This allows the AI to render the creator's face in various styles, such as the neon look they prefer. The process of creating self-portraits in this manner demonstrates the personalization capabilities of the AI when combined with custom embeddings.

๐Ÿ’กTextual Inversion Templates

Textual inversion templates are pre-defined text structures used in the process of training AI models like Stable Diffusion. They serve as a framework for creating prompts that guide the AI in generating specific types of images. In the video, the creator discusses using these templates to create effective prompts for training embeddings, which helps the AI understand the desired output, such as a particular style or aesthetic.

๐Ÿ’กVictorian Lace

Victorian Lace refers to a specific style of lace that was popular during the Victorian era, known for its intricate patterns and elegant designs. In the video, it is used as an example of how one can combine different embeddings to create a unique image. The creator demonstrates this by combining two embeddings, 'Victoria' and 'Lace', to generate an image that reflects both styles. This showcases the versatility and creative potential of using embeddings in Stable Diffusion.


Unsplash is a popular online platform that offers a vast collection of high-quality, royalty-free images. In the video, the creator plans to use Unsplash to find and download beautiful neon portraits, which will then be used to train a new embedding in Stable Diffusion. This demonstrates a practical application of publicly available resources to enhance the capabilities of AI models through custom training data.

๐Ÿ’กAnya Taylor-Joy

Anya Taylor-Joy is a talented actress known for her roles in various films and television series. In the video, the creator mentions using her as a reference for the AI model during the training process, likely due to her distinctive features and the creator's personal preference. This example highlights how individuals can use public figures or celebrities as a basis for training AI models to generate personalized content.

๐Ÿ’กNew York City

New York City, often simply referred to as New York, is the most populous city in the United States and is known for its iconic skyline, diverse culture, and vibrant nightlife. In the video, the creator mentions living in New York City and being inspired by its neon lights for the creation of neon-style portraits. The city serves as a backdrop and inspiration for the visual aesthetic that the creator is trying to capture and replicate with the AI model through embeddings.


The tutorial introduces embeddings in Stable Diffusion, a technique to customize the generation of images using the locally installed software.

For those without Stable Diffusion on their computers, the tutorial suggests using Google Colab and provides a link to Chrisard.helpers for embedding sensible diffusion.

The speaker shares their personal interest in neon-looking portraits and how they trained a model of their face in Stable Diffusion to render their own images.

An embeddings library has been created by the speaker, which is accessible on their website, offering a variety of styles for users to generate personalized portraits.

The tutorial demonstrates the process of using embeddings by downloading a specific image and naming it correctly to use in the Stable Diffusion web UI.

The importance of updating the Stable Diffusion app to access the embeddings folder is emphasized for users to proceed with the tutorial.

The speaker provides an example of generating a portrait using their trained model and an embedding style, showcasing the customization capabilities of Stable Diffusion.

The concept of 'embeddings' is explained as a way to incorporate specific styles or aesthetics into the generated images, such as neon lights or Victorian lace.

The tutorial includes a practical demonstration of combining two different embeddings to create a unique image, illustrating the creative potential of this feature.

The process of training embeddings is detailed, including the steps of collecting images, preprocessing, and using the Stable Diffusion web UI for training.

The tutorial emphasizes the importance of using descriptive and accurate prompts when training embeddings to ensure the desired style is captured.

The speaker shares their experience of experimenting with different models and embeddings, highlighting the trial-and-error nature of the learning process.

The tutorial concludes with a live demonstration of training an embedding using neon photographs, showcasing the practical application of the techniques discussed.

The speaker encourages users to share their own embeddings and to explore the creative possibilities of Stable Diffusion, fostering a community of users.

The tutorial provides insights into the technical aspects of Stable Diffusion, such as the use of square brackets to adjust the importance of words in the prompt.

The speaker's personal touch in creating a 'Chris Style' embedding reflects the potential for users to develop their own unique styles and contributions to the platform.