Closed Marcophono2 closed 1 year ago
Hey @Marcophono2,
Please note that the generator
should be passed through the call method and not the from_pretrained
method. See:
https://huggingface.co/docs/diffusers/main/en/api/pipelines/stable_diffusion/pix2pix#diffusers.StableDiffusionInstructPix2PixPipeline.__call__.generator
Okay. Thanks, @patrickvonplaten !
@patrickvonplaten Closed a moment too early... How does that call method work!? I never saw code with that call method. Are there Python templates available? Or is this per default for command line?
The __call__
method is called every time you do:
pipe = StableDiffusionPipeline.from_pretrained(....)
pipe("this is a prompt")
So when you just "call" the pipe
instance, Python "redirects" the function arguments automatically to the method defined as __call__
. Maybe also see: https://www.geeksforgeeks.org/__call__-in-python/
Describe the bug
Hello! I tried to use this code to generate a pix2pix image with a given seed:
model_id = "timbrooks/instruct-pix2pix"
The error message is
Keyword arguments {'generator': <torch._C.Generator object at 0x7f2676519ff0>} are not expected by StableDiffusionInstructPix2PixPipeline and will be ignored.
But on the other hand side I can fing the generator parameter in the pipeline_stable_diffusion_instruct_pix2pix.py
What am I doing wrong? I want to find out if the results are the same for same prompt, seed and all parameters in Automatic 1111 and if using Diffusers. If someone can confirm this I could quit to figure out the seed implementation. ;)
Reproduction
described above
Logs
No response
System Info
Diffusers 0.12.1 Ubuntu 22.04 Python 3.10.6 Torch 2.0.0 xFormers