[StableDiffusionPipeline] use default params in __call__ (#196)

use default params in __call__
This commit is contained in:
Suraj Patil 2022-08-17 17:06:12 +05:30 committed by GitHub
parent 80e0c8ba9e
commit f9522d825c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ pipe = StableDiffusionPipeline.from_pretrained(
prompt = "a photo of an astronaut riding a horse on mars"
with autocast("cuda"):
image = pipe(prompt, width=512, guidance_scale=7.5)["sample"][0]
image = pipe(prompt)["sample"][0]
image.save("astronaut_rides_horse.png")
```

View File

@ -31,7 +31,7 @@ class StableDiffusionPipeline(DiffusionPipeline):
height: Optional[int] = 512,
width: Optional[int] = 512,
num_inference_steps: Optional[int] = 50,
guidance_scale: Optional[float] = 1.0,
guidance_scale: Optional[float] = 7.5,
eta: Optional[float] = 0.0,
generator: Optional[torch.Generator] = None,
torch_device: Optional[Union[str, torch.device]] = None,