InvokeAI/ldm/invoke
Damian Stewart c6f31e5f36 fix off-by-one bug in cross-attention-control (#1774)
prompt token sequences begin with a "beginning-of-sequence" marker <bos> and end with a repeated "end-of-sequence" marker <eos> - to make a default prompt length of <bos> + 75 prompt tokens + <eos>. the .swap() code was failing to take the column for <bos> at index 0 into account. the changes here do that, and also add extra handling for a single <eos> (which may be redundant but which is included for completeness).

based on my understanding and some assumptions about how this all works, the reason .swap() nevertheless seemed to do the right thing, to some extent, is because over multiple steps the conditioning process in Stable Diffusion operates as a feedback loop. a change to token n-1 has flow-on effects to how the [1x4x64x64] latent tensor is modified by all the tokens after it, - and as the next step is processed, all the tokens before it as well. intuitively, a token's conditioning effects "echo" throughout the whole length of the prompt. so even though the token at n-1 was being edited when what the user actually wanted was to edit the token at n, it nevertheless still had some non-negligible effect, in roughly the right direction, often enough that it seemed like it was working properly.
2022-12-05 19:44:05 +01:00
..
generator inpainting for the normal model [WIP] 2022-12-04 23:36:12 -08:00
restoration Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00
__init__.py Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00
args.py add always_use_cpu arg to bypass MPS 2022-12-04 15:15:39 +01:00
CLI.py add always_use_cpu arg to bypass MPS 2022-12-04 15:15:39 +01:00
concepts_lib.py fix startup messages and a startup crash 2022-12-01 07:42:31 -05:00
conditioning.py fix off-by-one bug in cross-attention-control (#1774) 2022-12-05 19:44:05 +01:00
devices.py add always_use_cpu arg to bypass MPS 2022-12-04 15:15:39 +01:00
globals.py add always_use_cpu arg to bypass MPS 2022-12-04 15:15:39 +01:00
image_util.py Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00
log.py rename all modules from ldm.dream to ldm.invoke 2022-10-08 11:37:23 -04:00
model_cache.py 🚧 post-rebase repair 2022-11-30 15:39:40 -08:00
pngwriter.py fix a few more metadata bugs 2022-10-25 00:31:43 -04:00
prompt_parser.py Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00
readline.py defer loading of Hugging Face concepts until needed 2022-12-01 17:56:18 -05:00
seamless.py Split seamless config into separate file 2022-10-17 19:31:20 -04:00
server_legacy.py Add back old dream.py as legacy_api.py 2022-10-12 20:35:56 -04:00
server.py Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00
txt2mask.py Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00