Skip to content

Commit bac8fc4

Browse files
enh: make stability_sdk optional for illustrator
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent e6fcad1 commit bac8fc4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

illustrator.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131

3232
import litellm
3333
from litellm import completion, image_generation
34-
from stability_sdk import client
35-
import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
3634

3735
from utils.misc import send_ntfy, load_formatting_funcs, replace_media
3836
from utils.llm import load_api_keys, llm_price, sd_price, tkn_len, chat, model_name_matcher
@@ -52,6 +50,12 @@
5250
Path(log_file).touch()
5351
whi, yel, red = create_loggers(log_file, ["white", "yellow", "red"])
5452

53+
try:
54+
from stability_sdk import client
55+
import stability_sdk.interfaces.gooseai.generation.generation_pb2 as generation
56+
# make stability_sdk optional if the user has trouble installing the lib and needs only Dall-E
57+
except Exception as err:
58+
red(f"Error when importing stability_sdk, you won't be able to use stable diffusion: '{err}'")
5559

5660
# The Major System is a mnemonic system for memorizing numbers by converting them
5761
# to consonant sounds, then into words. This table maps digits to their corresponding

0 commit comments

Comments
 (0)