InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

Can Textual Inversion images be recreated with the same seed on another PCs?

Open morganavr opened this issue 4 years ago • 13 comments

Using Textual inversion I have teached SD to generate plastic figures. But when I sent the prompt below to my friend he got a completely different image. How is it possible? He uses lstein fork also (the latest version, and I use version released few days ago) I thought that identical prompt + seed should result in identical images... Can somebody check if you get the same image?

python scripts/dream.py --embedding_path emb/embeddings-d1.pt

"a photo of *" -s50 -b1 -W512 -H512 -C10.0 -S3224941461

embeddings-d1.gz (you need to create "emb" folder and place that file inside and change file extension from .gz to .pt)

003101__ 3224941461

morganavr avatar Aug 30 '22 09:08 morganavr

I got this with k_lms. What sampler were you using?

000002 3224941461

blessedcoolant avatar Aug 30 '22 15:08 blessedcoolant

I did not specify any sampler. Inside PNG this metadata is written: "a photo of *" -s50 -b1 -W512 -H512 -C10.0 -mk_lms -S3224941461

Is it possible that sd14.ckpt was updated recently? It could explain a difference. I downloaded model from https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt

MD5 hash of my model.ckpt:
c01059060130b8242849d86e97212c84

On Windows you can calculate MD5 hash with this command: certutil -hashfile <file> MD5

morganavr avatar Aug 30 '22 15:08 morganavr

"a photo of *" -s50 -b1 -W512 -H512 -C10.0 -S3224941461 "a photo of *" -s50 -b1 -W512 -H512 -C10.0 -mk_lms -S3224941461 a photo of * -s50 -b1 -W512 -H512 -C10.0 -mk_lms -S3224941461 a photo of * -s50 -b1 -W512 -H512 -C10.0 -S3224941461 all gave me the same result: 000001 3224941461

Ratinod avatar Aug 30 '22 16:08 Ratinod

Very interesting! We have the same results with @Ratinod but @blessedcoolant generated a different image.

morganavr avatar Aug 30 '22 16:08 morganavr

I couldn't find an image similar to that of @blessedcoolant by changing samplers claytest

Ratinod avatar Aug 30 '22 16:08 Ratinod

Let me get this updated model and try again.

blessedcoolant avatar Aug 30 '22 16:08 blessedcoolant

@blessedcoolant what is MD5 checksum of your model.ckpt file? In my post above I wrote how to see it.

morganavr avatar Aug 30 '22 16:08 morganavr

@blessedcoolant what is MD5 checksum of your model.ckpt file? In my post above I wrote how to see it.

They're different. Also I was using the non-ema model. Maybe that was the difference maker. I'll download and try the ema one.

Edit: Yep. That was the difference. The 4GB model gave me the result I posted. The 7GB ema one gives me what OP posted.

blessedcoolant avatar Aug 30 '22 16:08 blessedcoolant

By the way. @morganavr, how long have you been training the "Textual inversion"? It's not entirely clear how to decipher this "~1h @1.6 iterations/sec"...

Ratinod avatar Aug 30 '22 16:08 Ratinod

They're different. Also I was using the non-ema model. Maybe that was the difference maker. I'll download and try the ema one.

Edit: Yep. That was the difference. The 4GB model gave me the result I posted. The 7GB ema one gives me what OP posted.

@blessedcoolant So is one "better" than the other? All the instructions I found online pointed towards the 4gb file. Is there any reason to used the 7gb file over the 4gb file? I don't have a good enough technical understanding to know. Thanks!

namion avatar Aug 30 '22 17:08 namion

@blessedcoolant So is one "better" than the other? All the instructions I found online pointed towards the 4gb file. Is there any reason to used the 7gb file over the 4gb file? I don't have a good enough technical understanding to know. Thanks!

I haven't done extensive checks on this but from the few samples I generated, I personally prefer the results of the 4gb model. It converges much faster on most of the samplers and the results seem to high quality and accurate.

blessedcoolant avatar Aug 30 '22 17:08 blessedcoolant

By the way. @morganavr, how long have you been training the "Textual inversion"? It's not entirely clear how to decipher this "~1h @1.6 iterations/sec"...

around 1 hour on Google Colab free T4 GPU

morganavr avatar Aug 30 '22 17:08 morganavr

I think this issue can be closed. Reason for difference was a different model ckpt file.

morganavr avatar Aug 30 '22 17:08 morganavr