Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting different results with the same seed #169

Closed
stawiski opened this issue Jan 14, 2023 · 4 comments
Closed

Getting different results with the same seed #169

stawiski opened this issue Jan 14, 2023 · 4 comments

Comments

@stawiski
Copy link

Hi,

I'm using python SDK and getting different results while using the same seed between stability python SDK and Dreambooth UI.
I'm expecting python SDK to produce the same image for the same prompt + seed + configuration, however the image comes out different.

Here's what I've tried:

Dreambooth:
image

Python SDK:

python -m stability_sdk --seed 1671915829 -n 1 --engine "stable-diffusion-v1-5" --steps 30 --cfg_scale 7  "lion head smiling"

image

Cheers

@sedetweiler
Copy link

sedetweiler commented Jan 14, 2023 via email

@stawiski
Copy link
Author

Hey @sedetweiler, I used Dreambooth instead of running this on my own hardware.
And you're right, I do get the same picture when I disable "CLIP Guidance" in Dreambooth.

However, I can't information in the SDK about CLIP guidance, does this mean this feature is only available via web in Dreambooth?

@pharmapsychotic
Copy link
Member

@stawiski you can use CLIP guidance with the SDK. Check out the StabilityInference generate method and it has parameters:

        guidance_preset: generation.GuidancePreset = generation.GUIDANCE_PRESET_NONE,
        guidance_cuts: int = 0,
        guidance_strength: Optional[float] = None,
        guidance_prompt: Union[str, generation.Prompt] = None,
        guidance_models: List[str] = None,

Just pass generation.GUIDANCE_PRESET_FAST_BLUE for example for the guidance_preset (you can leave the others at their defaults). As @sedetweiler mentioned though when using CLIP guidance you won't get back the same result each time even if you use the same seed.

@stawiski
Copy link
Author

@pharmapsychotic you're right! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@sedetweiler @stawiski @pharmapsychotic and others