Skip to content

Commit a595a95

Browse files
committed
update readme
1 parent 1afd7c0 commit a595a95

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ComfyUI Textual Inversion Training
2+
To train textual inversion embedding directly from ComfyUI pipeline.
3+
Training scripts are modified version of diffusers examples: https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion
4+
5+
## Install
6+
Follow the installation here:
7+
https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion
8+
9+
Then clone the repository inside custom_nodes:
10+
```
11+
git clone github.com/mbrostami/ComfyUI-TITrain
12+
cd ComfyUI-TITrain
13+
pip install -r requirements.txt
14+
```
15+
16+
Restart and refresh the ComfyUI.
17+
18+
## Nodes
19+
### Textual Inversion Training SD1.5
20+
This node is designed to train SD 1.5 encoder (with progress bar)
21+
([./screenshot.png)[img]
22+
23+
<img alt="alt_text" src="screenshot.png" />
24+
25+
26+
## Parameters
27+
#### train_dir
28+
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.
29+
#### extra_prompts
30+
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)
31+
32+
33+
Other parameters are explained in diffusers repository:
34+
https://github.com/huggingface/diffusers/tree/main/examples/textual_inversion
35+
36+

screenshot.png

439 KB
Loading

training.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,11 @@ def train(
390390
return run_script(args, max_train_steps)
391391

392392
NODE_CLASS_MAPPINGS = {
393-
"TextualInversionTrainingSDXL": TextualInversionTrainingSDXL,
393+
# "TextualInversionTrainingSDXL": TextualInversionTrainingSDXL,
394394
"TextualInversionTraining": TextualInversionTraining
395395
}
396396

397397
NODE_DISPLAY_NAME_MAPPINGS = {
398-
"TextualInversionTrainingSDXL": "Textual Inversion Training SDXL",
398+
# "TextualInversionTrainingSDXL": "Textual Inversion Training SDXL",
399399
"TextualInversionTraining": "Textual Inversion Training SD1.5"
400400
}

0 commit comments

Comments
 (0)