2022-09-18 00:02:45 +00:00
|
|
|
import os.path
|
2022-09-11 06:27:22 +00:00
|
|
|
|
2022-09-15 02:40:50 +00:00
|
|
|
# tells pytorch to allow MPS usage (for Mac M1 compatibility)
|
2022-09-11 06:27:22 +00:00
|
|
|
os.putenv("PYTORCH_ENABLE_MPS_FALLBACK", "1")
|
2022-09-26 06:27:03 +00:00
|
|
|
import PIL.Image # noqa
|
2022-09-11 06:27:22 +00:00
|
|
|
|
2022-09-13 07:27:53 +00:00
|
|
|
from .api import imagine, imagine_image_files # noqa
|
2022-09-20 04:15:38 +00:00
|
|
|
from .enhancers.describe_image_blip import generate_caption # noqa
|
2022-09-16 06:06:59 +00:00
|
|
|
from .schema import ( # noqa
|
|
|
|
ImaginePrompt,
|
|
|
|
ImagineResult,
|
|
|
|
LazyLoadingImage,
|
|
|
|
WeightedPrompt,
|
|
|
|
)
|
2023-01-18 17:00:25 +00:00
|
|
|
from .version import __version__ # noqa
|
2022-09-18 00:02:45 +00:00
|
|
|
|
2022-09-26 06:27:03 +00:00
|
|
|
# https://stackoverflow.com/questions/71738218/module-pil-has-not-attribute-resampling
|
|
|
|
if not hasattr(PIL.Image, "Resampling"): # Pillow<9.0
|
|
|
|
PIL.Image.Resampling = PIL.Image
|