]> git.cworth.org Git - zombocom-ai/commitdiff
Switch to new 2.1 model of Stable Diffusion and also 768x768 pixels
authorCarl Worth <cworth@cworth.org>
Wed, 7 Dec 2022 19:52:44 +0000 (11:52 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 7 Dec 2022 19:52:44 +0000 (11:52 -0800)
That's a slightly more expensive mode to run in, but should still give
up to 1000 images for only $10.

generate-image.py

index 3a2d3f3f65593fdd03a4b308af3ebd412295abf0..408fe21bebfe8086accbf4f373176970fa6dcaaa 100755 (executable)
@@ -63,15 +63,17 @@ def main() -> None:
     stability_api = client.StabilityInference(
         key=os.environ['STABILITY_KEY'],
         verbose=True,
-        engine="stable-diffusion-512-v2-0"
+        engine="stable-diffusion-768-v2-1"
     )
 
     prompt_string = " ".join(args.prompt)
 
     if args.seed:
-        answers = stability_api.generate(seed=args.seed, prompt=prompt_string)
+        answers = stability_api.generate(width=768, height=768,
+                                         seed=args.seed, prompt=prompt_string)
     else:
-        answers = stability_api.generate(prompt=prompt_string)
+        answers = stability_api.generate(width=768, height=768,
+                                         prompt=prompt_string)
 
     results = []
     for resp in answers: