mirror of
https://github.com/brycedrennan/imaginAIry
synced 2024-11-17 09:25:47 +00:00
9eacf5e7ed
just running `aimg --help` or `aimg --version` was very slow due to all the imports being brought in eagerly Before changes `aimg --help` `2.24s user 4.05s system 184% cpu 3.416 total` After changes: `0.04s user 0.02s system 8% cpu 0.625 total` Used `PYTHONPROFILEIMPORTTIME=1 aimg --help` to find time consuming imports. Also switched to using `scripts` instead of `entrypoints` since the scripts are much faster. Made duplicate SAMPLER_TYPE_OPTIONS that can be loaded without loading all the samplers themselves. Likely a breaking change - not sure.
13 lines
286 B
Python
13 lines
286 B
Python
import os
|
|
|
|
# tells pytorch to allow MPS usage (for Mac M1 compatibility)
|
|
os.putenv("PYTORCH_ENABLE_MPS_FALLBACK", "1")
|
|
|
|
from .api import imagine, imagine_image_files # noqa
|
|
from .schema import ( # noqa
|
|
ImaginePrompt,
|
|
ImagineResult,
|
|
LazyLoadingImage,
|
|
WeightedPrompt,
|
|
)
|