justinpinkney / stable-diffusion

MIT License
1.46k stars 269 forks source link

how to retrain a image-condition model? #55

Open pokameng opened 1 year ago

pokameng commented 1 year ago

@justinpinkney hello,bro Your work is great!!! Can you tell me how to train the image-condition model on custdom dataset? I don't find the Training was done using a [modified version of the original Stable Diffusion training code](https://huggingface.co/lambdalabs/sd-image-variations-diffusers/blob/main/(https://github.com/justinpinkney/stable-diffusion). Something is empty.

Can you reload this code? Thanks!!!

pokameng commented 1 year ago

@justinpinkney

GuangTingZheng commented 11 months ago

@pokameng I solve this issue: from io import BytesIO from PIL import Image def pre_process(examples): processed = {} processed[image_key] = [Image.open(BytesIO(tform(im['bytes']))) for im in examples[image_column]] processed[caption_key] = examples[text_column] return processed