Skip to content

Commit 649035d

Browse files
authored
Update README.md to include training instructions
1 parent 0eef3a5 commit 649035d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,41 @@ If you wanna use custom styles, then clone the original repo and use train.py sc
1515
Probably the usual. Just "git clone https://github.com/zeroxoxo/ComfyUI-Fast-Style-Transfer.git" into your custom_nodes folder. That should be it.
1616

1717
If it doesn't work then idk, ask stack exchange or something, how should I know what's wrong with your setup?
18+
19+
# Training
20+
21+
First you'll need to download some files:
22+
23+
VGG-16: https://github.com/jcjohnson/pytorch-vgg
24+
25+
Put it into vgg folder.
26+
27+
28+
MS COCO train dataset.
29+
30+
Original repo suggests train-2014 dataset from here: https://cocodataset.org/#download
31+
32+
But be wary that it's 13Gb.
33+
34+
I used MS COCO train-2017 dataset downscaled to 256x256 from here: https://academictorrents.com/details/eea5a532dd69de7ff93d5d9c579eac55a41cb700
35+
36+
It's only 1.64Gb and original repo still used training with 256x256 size images but it manually downscaled it from the 13Gb dataset.
37+
38+
Put the train-2017 (or train-2014) folder into dataset folder.
39+
40+
41+
That's it for downloads.
42+
43+
Now just use ComfyUI to load TrainFastStyleTransfer node.
44+
45+
To select style picture load "load_image" node, load image inside of it, then press f5, now the image should be in style_img list inside of TrainFastStyleTransfer node, select it.
46+
47+
Adjust batch_size as high as you can with your vram. On my 2060 setup I got 5.9 Gb vram usage running batch_size = 12 ("nvidia-smi" command can be used in cmd to check current vram usage). If you have more you can crank it higher to drastically reduce training time.
48+
49+
One epoch should be fine, but you can test more on your own if your setup is fast enough or you have spare time.
50+
51+
save_model_every will save model and produce test picture every n-th step of training.
52+
53+
After setting all parameters just queue prompt and wait until training is done. Training a model can take up to 2 hours, so have patience.
54+
55+
All intermediate and final models will be saved in models folder, test them, delete redundant and rename the one you like.

0 commit comments

Comments
 (0)