From bbe235de74d152072032c2d480f1ac2486c9970c Mon Sep 17 00:00:00 2001 From: florestefano1975 <153757302+florestefano1975@users.noreply.github.com> Date: Sun, 21 Apr 2024 09:16:23 +0200 Subject: [PATCH] Implementation of styles for Image Core (#1) - On/off switch for applying a style. - Style selector. - Modification of the "StabilityBase" class to check for the presence of the style among the dispatch parameters with the API. --- stability_api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stability_api.py b/stability_api.py index 6ee1985..8ea5e8c 100644 --- a/stability_api.py +++ b/stability_api.py @@ -56,6 +56,10 @@ class StabilityBase: else: kwargs.pop("strength", None) + style = kwargs.get('style', False) + if style is False: + kwargs.pop('style_preset', None) + headers = { "Authorization": API_KEY, } @@ -149,6 +153,8 @@ class StabilityCore(StabilityBase): "seed": ("INT", {"default": 0, "min": 0, "max": 4294967294}), "output_format": (["png", "webp", "jpeg"],), "aspect_ratio": (["16:9", "1:1", "21:9", "2:3", "3:2", "4:5", "5:4", "9:16", "9:21"],), + "style": ("BOOLEAN", {"default": False}), + "style_preset": (["3d-model", "analog-film", "anime", "cinematic", "comic-book", "digital-art", "enhance", "fantasy-art", "isometric", "line-art", "low-poly", "modeling-compound", "neon-punk", "origami", "photographic", "pixel-art", "tile-texture"],), "api_key_override": ("STRING", {"multiline": False}), } }