Nodes Browser

ComfyDeploy: How ComfyUI-TITrain works in ComfyUI?

What is ComfyUI-TITrain?

Nodes:TextualInversionTrainingSDXL, TextualInversionTraining

How to install it in ComfyDeploy?

Head over to the machine page

  1. Click on the "Create a new machine" button
  2. Select the Edit build steps
  3. Add a new step -> Custom Node
  4. Search for ComfyUI-TITrain and select it
  5. Close the build step dialig and then click on the "Save" button to rebuild the machine

ComfyUI Textual Inversion Training

To train textual inversion embedding directly from ComfyUI pipeline.
Training scripts are modified version of diffusers examples: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion

Install

Follow the installation here: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion

Then clone the repository inside custom_nodes:

git clone github.com/mbrostami/ComfyUI-TITrain
cd ComfyUI-TITrain
pip install -r requirements.txt

Restart and refresh the ComfyUI.

Nodes

Textual Inversion Training SD1.5

This node is designed to train SD 1.5 encoder (with progress bar)
([./screenshot.png)[img]

<img alt="alt_text" src="screenshot.png" />

Parameters

train_dir

This is where the input images are going to be stored, if directory doesn't exist in ComfyUI/output/ it will be created. Consider changing the value if you want to train different embeddings.

extra_prompts

There are list of prompts inside the training script, that is shuffled with each image to be used for training. I added this extra prompts that you can put additional prompt in each line, so randomly selected line from here will be appended to the final prompt. Usually you should put a part of prompt that you don't want to be considered as the embedding itself. (e.g. white background, close up, tattoo, etc)

Other parameters are explained in diffusers repository: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion