Commit graph

114 commits

Author SHA1 Message Date
Laurent ef0a7525a8 add DINOv2 similarity to compare_images + relax some test constraints 2024-10-14 15:12:59 +02:00
Laurent 316fe6e4f0 update tests to use new fixtures 2024-10-14 15:12:59 +02:00
Laurent f3d2b6c325 modify some foundational tests to also test in float16 and bfloat16 2024-10-03 11:05:09 +02:00
Pierre Chapuis ed7e2e5964 check timesteps stay the same in bfloat16 2024-09-26 08:55:07 +02:00
Pierre Chapuis f1c8503e68 use default (1e-8) atol for basic DPM solver (used in SD1.5) 2024-09-26 08:55:07 +02:00
Pierre Chapuis 83b931296f fix DPM-Solver with bfloat16
Some checks are pending
CI / lint_and_typecheck (push) Waiting to run
Deploy docs to GitHub Pages / Deploy docs (push) Waiting to run
Spell checker / Spell check (push) Waiting to run
2024-09-25 14:41:19 +02:00
Pierre Chapuis 73089a4e2d fix typing issue in dinov2 test
Some checks failed
CI / lint_and_typecheck (push) Has been cancelled
Deploy docs to GitHub Pages / Deploy docs (push) Has been cancelled
Spell checker / Spell check (push) Has been cancelled
2024-09-18 10:44:24 +02:00
Laurent 2c0174f50e rename test_unet.py to test_sd15_unet.py + use test_device fixture
Some checks failed
CI / lint_and_typecheck (push) Has been cancelled
Deploy docs to GitHub Pages / Deploy docs (push) Has been cancelled
Spell checker / Spell check (push) Has been cancelled
2024-09-10 09:16:22 +02:00
Laurent 444882a734 move some tests into the adapters test folder
Some checks are pending
CI / lint_and_typecheck (push) Waiting to run
Deploy docs to GitHub Pages / Deploy docs (push) Waiting to run
Spell checker / Spell check (push) Waiting to run
2024-09-09 17:44:26 +02:00
Laurent 6d58492097 loosen the tolerances for some sam tests (because of a recent pytorch upgrade) 2024-09-09 17:17:12 +02:00
limiteinductive af6c5aecbe add karras sigmas to dpm solver 2024-09-06 15:30:02 +02:00
limiteinductive 1de567590b fix typing issues coming from torch 2.4 version ; typing is not guaranteed for torch < 2.4 2024-08-02 12:02:00 +02:00
limiteinductive 09a9dfd494 Add stochastic sampling to DPM solver (SDE)
Some checks are pending
CI / lint_and_typecheck (push) Waiting to run
Deploy docs to GitHub Pages / Deploy docs (push) Waiting to run
Spell checker / Spell check (push) Waiting to run
2024-07-23 11:13:12 +02:00
Pierre Chapuis daee77298d improve FrankenSolver
It now takes a Scheduler factory instead of a Scheduler.
This lets the user potentially recreate the Scheduler on `rebuild`.

It also properly sets the device and dtype on rebuild,
and it has better typing.
2024-07-19 16:46:52 +02:00
Laurent f44ae150a7 improve/add MultiDiffusion and MultiUpscaler e2e tests
Co-authored-by: limiteinductive <benjamin@lagon.tech>
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
2024-07-11 15:23:02 +02:00
Pierre Chapuis b4db08de24 use "solver" (not scheduler) wording in tests 2024-07-10 19:31:34 +02:00
Pierre Chapuis 9e8c2a3753 add FrankenSolver
This solver is designed to use Diffusers Schedulers as Refiners Solvers.
2024-07-10 19:31:34 +02:00
limiteinductive b42881e54e Implement Tiled Autoencoder inference to save VRAM 2024-06-26 11:59:18 +02:00
Pierre Chapuis 9be3580ab3 avoid OOMs in SAM tests 2024-06-24 17:19:05 +02:00
Pierre Chapuis 2ba83f575e switch pytest import mode to importlib
see:
https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#choosing-an-import-mode
https://docs.pytest.org/en/7.1.x/explanation/pythonpath.html#import-modes

This change fixes the SAM tests.
2024-06-24 17:19:05 +02:00
Laurent 7aff743019 initialize StableDiffusion_1_Inpainting with a 9 channel SD1Unet if not provided 2024-04-23 16:58:22 +02:00
Laurent 17246708b9 Add sample_noise staticmethod and modify add_noise to support batched steps 2024-04-18 12:55:49 +02:00
Pierre Colle bf7852b88e SAM: image_to_scaled_tensor gray images 2024-04-16 18:45:17 +02:00
limiteinductive f48712ee29 lint 2024-04-16 16:24:33 +02:00
limiteinductive 347fdbc794 add init file for segment_anything tests 2024-04-16 16:24:33 +02:00
Pierre Colle 0ac290f67d SAM: expose sizing helpers 2024-04-12 08:56:23 +02:00
Laurent 06ff2f0a5f add support for dinov2 giant flavors 2024-04-11 14:48:33 +02:00
Laurent 2ecf7e4b8c skip dinov2 float16 test on cpu + test dinov2 when batch_size>1 2024-04-02 18:57:25 +02:00
Pierre Chapuis fd5a15c7e0 update pyright and fix Pillow 10.3 typing issues 2024-04-02 18:15:52 +02:00
Laurent 1a8ea9180f refactor dinov2 tests, check against official implementation 2024-04-02 10:02:43 +02:00
Pierre Colle 6c37e3f933 hq-sam : weights/load_weights 2024-03-29 11:25:43 +01:00
Pierre Colle cba83b0558 SAM init with mask_decoder after #325 2024-03-24 20:18:57 +01:00
Pierre Colle 5c937b184a HQ-SAM logit equal test, following #331 2024-03-23 21:58:32 +01:00
Pierre Colle 2763db960e SAM e2e test tolerance explained 2024-03-22 21:31:28 +01:00
hugojarkoff a93ceff752 Add HQ-SAM Adapter 2024-03-21 15:36:55 +01:00
hugojarkoff c6b5eb24a1 Add logits comparison for base SAM in single mask output prediction mode 2024-03-21 10:48:48 +01:00
Pierre Colle 68fe725767 Add multimask_output flag to SAM 2024-03-19 17:40:26 +01:00
Pierre Chapuis 052a20b897 remove add_multiple_loras 2024-03-08 15:43:57 +01:00
Pierre Chapuis be2368cf20 ruff 3 formatting (Rye 0.28) 2024-03-08 10:42:05 +01:00
Pierre Chapuis a0be5458b9 snip long prompt in tests 2024-03-05 19:54:44 +01:00
Pierre Chapuis bf0ba58541 refactor solver params, add sample prediction type 2024-02-26 12:14:02 +01:00
Pierre Chapuis ddc1cf8ca7 refactor solvers to support different timestep spacings 2024-02-26 12:14:02 +01:00
Pierre Chapuis c8c6294550 add LCMSolver (Latent Consistency Models) 2024-02-21 16:37:27 +01:00
Pierre Colle d199cd4f24 batch sdxl + sd1 + compute_clip_text_embedding
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
2024-02-21 15:17:11 +01:00
Pierre Chapuis 471ef91d1c make __getattr__ on Module return object, not Any
PyTorch chose to make it Any because they expect its users' code
to be "highly dynamic": https://github.com/pytorch/pytorch/pull/104321

It is not the case for us, in Refiners having untyped code
goes contrary to one of our core principles.

Note that there is currently an open PR in PyTorch to
return `Module | Tensor`, but in practice this is not always
correct either: https://github.com/pytorch/pytorch/pull/115074

I also moved Residuals-related code from SD1 to latent_diffusion
because SDXL should not depend on SD1.
2024-02-06 11:32:18 +01:00
Pierre Chapuis 3de1508b65 increase tolerance on Euler test 2024-02-04 08:58:22 +01:00
Pierre Chapuis 83b478c0ff fix test failure caused by Diffusers 0.26.0 2024-02-04 08:58:22 +01:00
Colle 4a6146bb6c clip text, lda encode batch inputs
* text_encoder([str1, str2])
* lda decode_latents/encode_image image_to_latent/latent_to_image
* images_to_tensor, tensor_to_images
---------
Co-authored-by: Cédric Deltheil <355031+deltheil@users.noreply.github.com>
2024-02-01 17:05:28 +01:00
Pierre Chapuis 3ddd258d36 add a test for noise schedules 2024-02-01 16:17:07 +01:00
Pierre Chapuis df843f5226 test SAG setter 2024-02-01 16:17:07 +01:00