Commit Graph

50 Commits

Author SHA1 Message Date
lllyasviel
88f395091b
add two optimizations
--pin-shared-memory and --cuda-malloc

See also the updates in Readme for more details
2024-02-23 18:39:32 -08:00
lllyasviel
54c89503eb Disable pin page
This is an emergency fix

GTX 1060/1050/1066 either does not have shared GPU page vram or have less than 2GB shared page vram - pinning any tensors larger than that will crash

Solution is still under investigation.
2024-02-23 16:43:08 -08:00
lllyasviel
bde779a526 apply_token_merging 2024-02-23 15:43:27 -08:00
lllyasviel
2a7fb1be24 less verbose 2024-02-23 14:22:37 -08:00
lllyasviel
ad0ce480f9 always print time 2024-02-23 13:02:30 -08:00
lllyasviel
df12dde12e
Rework unload system
Previous repeated loading (on cn or other extensions) is fixed. ControlNet saves about 0.7 to 1.1 seconds on my two device when batch count > 1. 

8GB VRAM can use SDXL at resolution 6144x6144 now, out of the box, without tiled diffusion or other things. 

(the max resolution on Automatic1111 txt2img UI is 2048 but one can highres fix to try 6144 or even 8192)
2024-02-23 12:58:09 -08:00
lllyasviel
19473b1a26 fix ci 2024-02-23 09:44:08 -08:00
lllyasviel
26c325296e
rework memory computation for async loader (#377) 2024-02-23 09:24:39 -08:00
lllyasviel
eacb14e115 tune threshold based on more test devices
for async mover
2024-02-22 17:18:31 -08:00
lllyasviel
8283774b86 revise caster 2024-02-22 10:24:27 -08:00
lllyasviel
6ebef20db3 avoid potential OOM caused by computation being slower than mover
avoid OOM (or shared vram invoking) caused by computation being slower than mover (GPU filled with loaded  but uncomputed tensors), by setting the max async overhead to 512MB
2024-02-22 08:24:23 -08:00
lllyasviel
167dbc6411 safe value for new memory peak 2024-02-22 06:31:21 -08:00
lllyasviel
539bc5035d safe cleanup to avoid potential problems 2024-02-22 01:28:38 -08:00
lllyasviel
4080e25805 add todo note 2024-02-22 00:47:26 -08:00
lllyasviel
846fdc3341 also implement async offload to control-lora
controlnet, t2iadapters, etc
2024-02-22 00:20:35 -08:00
lllyasviel
638ee43bf1 Merge upstream PR 14855 2024-02-21 23:59:40 -08:00
lllyasviel
3cdae09639 try solve saturation problems for instant id in #155 2024-02-11 20:53:17 -08:00
lllyasviel
237f80681a add more notes to clip codes 2024-02-11 20:28:02 -08:00
lllyasviel
30dd8af08c fix error in head info 2024-02-11 20:12:27 -08:00
lllyasviel
3d039591fe Expand head info in files
Previously before this commit, credits are already in entry and licenses are already in root. This commit will make info clearer.
2024-02-11 19:55:18 -08:00
lllyasviel
998327c744 add edit model 2024-02-10 03:24:40 -08:00
Chengsong Zhang
ee565b337c
ControlNet batch fix (#113)
* cn forward patcher

* simplify

* use args instead of kwargs

* postpond moving cond_hint to gpu

* also do this for t2i adapter

* use a1111's code to load files in a batch

* revert

* patcher for batch images

* patcher for batch images

* remove cn fn wrapper dupl

* remove shit

* use unit getattr instead of unet patcher

* fix bug

* small changte
2024-02-09 21:55:29 -06:00
lllyasviel
dca0a1d5d8
Integrate Multi Diffusion
Integrated Multi Diffusion, based on codes from pkuliyi2015 and shiimizu
Basic Diffusion test passed
ControlNet test passed
2024-02-09 18:37:32 -08:00
lllyasviel
fb2e271668 support inpaint models from fooocus
put inpaint_v26.fooocus.patch in models\ControlNet, control SDXL models only
To get same algorithm as Fooocus, set "Stop at" (Ending Control Step) to 0.5
Fooocus always use 0.5 but in Forge users may use other values.
Results are best when stop at < 0.7. The model is not optimized with ending timesteps > 0.7
Supports inpaint_global_harmonious, inpaint_only, inpaint_only+lama.
In theory the inpaint_only+lama always outperform Fooocus in object removal task (but not all tasks).
2024-02-09 17:08:48 -08:00
Chenlei Hu
ac4a8820a5
Fix CQ tests (#141)
* Make test client run on cpu

* test on cpu

try fix device

try fix device

try fix device

* Use real SD1.5 model for testing

* ckpt nits

* Remove coverage calls
2024-02-09 16:33:05 -05:00
lllyasviel
4c9db26541 support controlnet_model_function_wrapper for t2i-adapter 2024-02-07 21:42:56 -08:00
lllyasviel
49ec325f6a lin 2024-02-07 20:14:02 -08:00
lllyasviel
a1670c536d Allow controlnet_model_function_wrapper
for animatediff to manage controlnet batch slicing window
2024-02-07 20:06:23 -08:00
lllyasviel
ef781cabcb Backend: Allow control signal to be none for advanced weighting 2024-02-07 13:02:42 -08:00
lllyasviel
c185e39e59 Backend: better controlnet mask batch broadcasting 2024-02-06 20:13:09 -08:00
Chengsong Zhang
b58b0bd425
batch mask (#44)
* mask batch, not working

* mask batch, working, infotext broken

* try remove old codes

* set CUDA_VISIBLE_DEVICES with args

* Revert "try remove old codes"

This reverts commit 63c527c373383f7eb99e134ca6b298bc613ac4ca.

* Update controlnet_ui_group.py

* readme

* 🐛 Fix infotext

---------

Co-authored-by: lllyasviel <lyuminzhang@outlook.com>
Co-authored-by: huchenlei <chenlei.hu@mail.utoronto.ca>
2024-02-06 12:54:35 -06:00
lllyasviel
88f6df4dcd add_sampler_pre_cfg_function 2024-02-05 14:48:43 -08:00
lllyasviel
40afb9dfb0 backend 2024-02-05 00:45:34 -08:00
lllyasviel
abcfd6bf97 backend 2024-02-04 15:40:02 -08:00
lllyasviel
67c87e6667 Update external_latent.py 2024-02-03 01:03:12 -08:00
lllyasviel
95c9ed52fc add block inner modifiers 2024-02-03 00:57:49 -08:00
lllyasviel
412bc10a01 update examples 2024-01-31 23:29:56 -08:00
lllyasviel
a203113f43 qol 2024-01-31 23:21:58 -08:00
lllyasviel
13246270fa Update samplers.py 2024-01-31 20:41:18 -08:00
lllyasviel
0727ff7334 Update controlnet.py 2024-01-31 19:37:14 -08:00
lllyasviel
611b234792 allow modify cnet cond 2024-01-31 19:10:36 -08:00
lllyasviel
91799fd48b Update path_utils.py 2024-01-31 12:19:17 -08:00
lllyasviel
028fccd3ba remove confusing codes 2024-01-31 11:57:17 -08:00
lllyasviel
071be046d2 backend 2024-01-31 09:46:24 -08:00
lllyasviel
862b61830c i 2024-01-30 21:58:16 -08:00
lllyasviel
08149179c4 Update external.py 2024-01-29 18:55:16 -08:00
lllyasviel
aec5053938 i 2024-01-27 09:44:44 -08:00
lllyasviel
e2e81aeb57 Update external_video_model.py 2024-01-25 22:47:20 -08:00
lllyasviel
24e3c9b5d4 i 2024-01-25 21:08:57 -08:00
lllyasviel
5ecc9e83bd files 2024-01-24 10:27:44 -08:00