InvokeAI/invokeai/app/invocations
psychedelicious 402cf9b0ee feat: refactor services folder/module structure
Refactor services folder/module structure.

**Motivation**

While working on our services I've repeatedly encountered circular imports and a general lack of clarity regarding where to put things. The structure introduced goes a long way towards resolving those issues, setting us up for a clean structure going forward.

**Services**

Services are now in their own folder with a few files:

- `services/{service_name}/__init__.py`: init as needed, mostly empty now
- `services/{service_name}/{service_name}_base.py`: the base class for the service
- `services/{service_name}/{service_name}_{impl_type}.py`: the default concrete implementation of the service - typically one of `sqlite`, `default`, or `memory`
- `services/{service_name}/{service_name}_common.py`: any common items - models, exceptions, utilities, etc

Though it's a bit verbose to have the service name both as the folder name and the prefix for files, I found it is _extremely_ confusing to have all of the base classes just be named `base.py`. So, at the cost of some verbosity when importing things, I've included the service name in the filename.

There are some minor logic changes. For example, in `InvocationProcessor`, instead of assigning the model manager service to a variable to be used later in the file, the service is used directly via the `Invoker`.

**Shared**

Things that are used across disparate services are in `services/shared/`:

- `default_graphs.py`: previously in `services/`
- `graphs.py`: previously in `services/`
- `paginatation`: generic pagination models used in a few services
- `sqlite`: the `SqliteDatabase` class, other sqlite-specific things
2023-10-12 12:15:06 -04:00
..
__init__.py Run python black 2023-07-28 09:46:44 -04:00
baseinvocation.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
collections.py feat: queued generation (#4502) 2023-09-20 15:09:24 +10:00
compel.py Merge branch 'main' into feat/ip-adapter 2023-09-15 13:15:25 -04:00
controlnet_image_processors.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
cv.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
facetools.py chore(facetools): bump node patch versions 2023-10-04 09:33:14 +11:00
image.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
infill.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
ip_adapter.py fix(nodes): fix ip-adapter field positioning on workflow editor 2023-09-20 21:52:29 -04:00
latent.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
math.py Add 'Random Float' node <3 (#4581) 2023-09-26 05:57:44 +00:00
metadata.py feat(nodes,ui): add t2i to linear UI 2023-10-07 22:30:15 +11:00
model.py feat(nodes): add version to node schemas 2023-09-04 19:08:18 +10:00
noise.py feat(nodes): add version to node schemas 2023-09-04 19:08:18 +10:00
onnx.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
param_easing.py isort wip 2023-09-12 13:01:58 -04:00
primitives.py feat: move board logic to save_image node 2023-09-22 10:11:20 -04:00
prompt.py feat: queued generation (#4502) 2023-09-20 15:09:24 +10:00
sdxl.py feat(nodes): add version to node schemas 2023-09-04 19:08:18 +10:00
strings.py Prompts from file support nodes (#3964) 2023-09-13 08:06:38 +00:00
t2i_adapter.py feat(nodes,ui): add t2i to linear UI 2023-10-07 22:30:15 +11:00
upscale.py feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00