InvokeAI/invokeai/app/invocations
Lincoln Stein e93f4d632d
[util] Add generic torch device class (#6174)
* introduce new abstraction layer for GPU devices

* add unit test for device abstraction

* fix ruff

* convert TorchDeviceSelect into a stateless class

* move logic to select context-specific execution device into context API

* add mock hardware environments to pytest

* remove dangling mocker fixture

* fix unit test for running on non-CUDA systems

* remove unimplemented get_execution_device() call

* remove autocast precision

* Multiple changes:

1. Remove TorchDeviceSelect.get_execution_device(), as well as calls to
   context.models.get_execution_device().
2. Rename TorchDeviceSelect to TorchDevice
3. Added back the legacy public API defined in `invocation_api`, including
   choose_precision().
4. Added a config file migration script to accommodate removal of precision=autocast.

* add deprecation warnings to choose_torch_device() and choose_precision()

* fix test crash

* remove app_config argument from choose_torch_device() and choose_torch_dtype()

---------

Co-authored-by: Lincoln Stein <lstein@gmail.com>
2024-04-15 13:12:49 +00:00
..
custom_nodes fix(nodes): gracefully handle custom nodes init error 2024-04-02 13:25:14 +11:00
__init__.py fix(config): remove unnecessary resolve on config path 2024-03-19 09:24:28 +11:00
baseinvocation.py fix(config): use new get_config across the app, use correct settings 2024-03-19 09:24:28 +11:00
collections.py fix(nodes): restore type annotations for InvocationContext 2024-03-01 10:42:33 +11:00
compel.py [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
constants.py chore: ruff formatting 2024-03-01 10:42:33 +11:00
controlnet_image_processors.py feat: adaptation of Lineart Anime processor 2024-03-21 07:02:57 -07:00
cv.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
facetools.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
fields.py Rename MaskField to be a generice TensorField. 2024-04-09 08:12:12 -04:00
image.py feat: Add Mask from ID Node 2024-03-22 06:23:51 +05:30
infill.py feat(nodes): disable mosaic fill 2024-04-05 08:49:13 +11:00
ip_adapter.py Add support for IP-Adapter masks. 2024-04-09 15:06:51 -04:00
latent.py [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
mask.py fix ruff issues 2024-04-12 07:19:16 +10:00
math.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
metadata.py feat: Let users pick CLIP Vision model for Checkpoint IP Adapters 2024-04-03 12:40:05 +05:30
model.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
noise.py [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
param_easing.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
primitives.py Rename MaskField to be a generice TensorField. 2024-04-09 08:12:12 -04:00
prompt.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
sdxl.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
strings.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
t2i_adapter.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
tiles.py chore: bump nodes versions 2024-03-20 10:28:07 +11:00
upscale.py [util] Add generic torch device class (#6174) 2024-04-15 13:12:49 +00:00
util.py fix(nodes): fix constraints/validation for controlnet 2024-01-02 07:28:53 -05:00