132 Commits

Author SHA1 Message Date
8d32ede082 tidy(nodes): remove matplotlib dependency
It was only used for a single color conversion function. Replaced with cv2 code, tested functionality to confirm it works the same.
2025-04-04 18:42:13 +11:00
8188484a40 tidy: delete unused file 2025-04-04 18:42:13 +11:00
986b7426d2 tidy(nodes): remove unused old dw openpose detector class 2025-04-04 18:42:13 +11:00
a6b94e8ca4 Revert some files 2025-03-26 13:18:50 +11:00
182580ff69 Imports 2025-03-26 12:55:10 +11:00
99aac5870e Remove star imports 2025-03-26 12:27:00 +11:00
f2689598c0 Formatting 2025-03-06 09:11:00 +11:00
e5180c4e6b Add get_effective_device(...) utility to aid in determining the effective device of models that are partially loaded. 2025-01-07 00:31:00 +00:00
a69c5ff9ef Add copyright notice for CIELab_to_UPLab.icc 2024-11-19 07:02:37 -08:00
1fd80d54a4 Run Ruff 2024-11-19 07:02:37 -08:00
991f63e455 Store CIELab_to_UPLab.icc within the repo 2024-11-19 07:02:37 -08:00
0eadc0dd9e feat: Support a subset of composition nodes within base invokeai 2024-11-19 07:02:37 -08:00
ff72315db2 feat(nodes): update SAM backend and nodes to work with SAM points 2024-10-23 16:01:15 +11:00
ba09c1277f feat(nodes): hacked together nodes for segment anything w/ points 2024-10-23 16:01:15 +11:00
0fd430fc20 fix(nodes): add thresholding to lineart & lineart anime nodes
The lineart model often outputs a lot of almost-black noise. SD1.5 ControlNets seem to be OK with this, but SDXL ControlNets are not - they need a cleaner map. 12 was experimentally determined to be a good threshold, eliminating all the noise while keeping the actual edges. Other approaches to thresholding may be better, for example stretching the contrast or removing noise.

I tried:
- Simple thresholding (as implemented here) - works fine.
- Adaptive thresholding - doesn't work, because the thresholding is done in the context of small blocks, while we want thresholding in the context of the whole image.
- Gamma adjustment - alters the white values too much. Hard to tuen.
- Contrast stretching, with and without pre-simple-thresholding - this allows us to treshold out the noise, then stretch everything above the threshold down to almost-zero. So you have a smoother gradient of lightness near zero. It works but it also stretches contrast near white down a bit, which is probably undesired.

In the end, simple thresholding works fine and is very simple.
2024-09-17 04:04:11 +03:00
248e4a81b2 fix(nodes): handle no detected line segments 2024-09-11 08:12:48 -04:00
b6aba92426 fix(nodes): MLSD needs inputs to be multiples of 64 2024-09-11 08:12:48 -04:00
4f2fc65257 tidy(nodes): MLSDEdgeDetection -> MLSDDetection
It's a line segment detector, not general edge detector.
2024-09-11 08:12:48 -04:00
ee4c0efbf7 feat(nodes): update pidinet node
Human-readable field names.
2024-09-11 08:12:48 -04:00
a4250e3ff2 feat(nodes): update mlsd node
Human-readable field names.
2024-09-11 08:12:48 -04:00
67a234c1bb feat(nodes): update content shuffle node
- Better field names
2024-09-11 08:12:48 -04:00
53792fafb3 feat(nodes): add DWOpenposeDetectionInvocation
Similar to the existing node, but without any resizing. The backend logic was consolidated and modified so that it the model loading can be managed by the model manager.

The ONNX Runtime `InferenceSession` class was added to the `AnyModel` union to satisfy the type checker.
2024-09-11 08:12:48 -04:00
615eddea6f feat(nodes): add PiDiNetEdgeDetectionInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.

All code related to the invocation now lives in the Invoke repo.
2024-09-11 08:12:48 -04:00
b3d60bd56a feat(nodes): add NormalMapInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.

All code related to the invocation now lives in the Invoke repo. Unfortunately, this includes a whole git repo for EfficientNet. I believe we could use the package `timm` instead of this, but it's beyond me.
2024-09-11 08:12:48 -04:00
fd42da5a36 feat(nodes): add MLSDEdgeDetectionInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.

All code related to the invocation now lives in the Invoke repo.
2024-09-11 08:12:48 -04:00
bc55791db1 feat(nodes): add MediaPipeFaceDetectionInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.

All code related to the invocation now lives in the Invoke repo.
2024-09-11 08:12:48 -04:00
c5f3297841 feat(nodes): add LineartEdgeDetectionInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.
2024-09-11 08:12:48 -04:00
cd2c2a7fde feat(nodes): add LineartAnimeEdgeDetectionInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.
2024-09-11 08:12:48 -04:00
1cffcc02a5 feat(nodes): add HEDEdgeDetectionInvocation
Similar to the existing node, but without any resizing and with a revised model loading API that uses the model manager.
2024-09-11 08:12:48 -04:00
ac9950bdbb feat(nodes): add DepthAnythingDepthEstimationInvocation
Similar to the existing node, but without any resizing and with a revised model loading API.
2024-09-11 08:12:48 -04:00
059d57f447 feat(nodes): add ContentShuffleInvocation
Similar to the existing node, but without the resolution fields.
2024-09-11 08:12:48 -04:00
4f8a4b0f22 Merge branch 'main' into depth_anything_v2 2024-08-03 00:38:57 +05:30
a743f3c9b5 fix: implement model to func for depth anything 2024-08-03 00:37:17 +05:30
b9dc3460ba Rename SegmentAnythingModel -> SegmentAnythingPipeline. 2024-08-01 09:57:47 -04:00
63581ec980 (minor) Add None check to fix static type checking error. 2024-08-01 09:51:53 -04:00
daf899f9c4 fix: Move the manual image resizing out of the depth anything pipeline 2024-07-31 23:38:12 +05:30
95dde802ea fix: assert the return depth map to be a PIL image 2024-07-31 23:22:01 +05:30
fca119773b Split invokeai/backend/image_util/segment_anything/ dir into grounding_dino/ and segment_anything/ 2024-07-31 12:28:47 -04:00
0193267a53 Split GroundedSamInvocation into GroundingDinoInvocation and SegmentAnythingModelInvocation. 2024-07-31 12:20:23 -04:00
b4cf78a95d fix: make DA Pipeline a subclass of RawModel 2024-07-31 21:14:49 +05:30
73386826d6 Make GroundingDinoPipeline and SegmentAnythingModel subclasses of RawModel for type checking purposes. 2024-07-31 10:25:34 -04:00
9f448fecb7 Move invokeai/backend/grounded_sam -> invokeai/backend/image_util/grounded_sam 2024-07-31 10:00:30 -04:00
18f89ed5ed fix: Make DepthAnything work with Invoke's Model Management 2024-07-31 03:57:54 +05:30
556c6a1d84 fix: Update DepthAnything to use the transformers implementation 2024-07-31 00:51:55 +05:30
e5d9ca013e fix: use v1 models for large and base versions 2024-07-25 17:24:12 +05:30
4166c756ce wip: depth_anything_v2 init lint fixes 2024-07-25 14:41:22 +05:30
4f0dfbd34d wip: depth_anything_v2 initial implementation 2024-07-25 13:53:06 +05:30
28e79c4c5e chore: ruff
Looks like an upstream change to ruff resulted in this file being a violation.
2024-07-15 14:05:04 +10:00
1d449097cc Apply ruff rule to disallow all relative imports. 2024-07-04 09:35:37 -04:00
987ee704a1 Merge branch 'main' into lstein/feat/simple-mm2-api 2024-05-17 22:54:03 -04:00