17 Commits

Author SHA1 Message Date
comfyanonymous
014c90584e Fix and enforce no trailing whitespace. 2024-12-31 03:16:37 -05:00
Raphael Walker
ec2ea78501 Add support for attention masking in Flux (#5942)
* fix attention OOM in xformers

* allow passing attention mask in flux attention

* allow an attn_mask in flux

* attn masks can be done using replace patches instead of a separate dict

* fix return types

* fix return order

* enumerate

* patch the right keys

* arg names

* fix a silly bug

* fix xformers masks

* replace match with if, elif, else

* mask with image_ref_size

* remove unused import

* remove unused import 2

* fix pytorch/xformers attention

This corrects a weird inconsistency with skip_reshape.
It also allows masks of various shapes to be passed, which will be
automtically expanded (in a memory-efficient way) to a size that is
compatible with xformers or pytorch sdpa respectively.

* fix mask shapes
2024-12-16 18:21:17 -05:00
comfyanonymous
c348659633 Support new flux model variants. 2024-11-21 08:38:23 -05:00
comfyanonymous
d0ec0081c4 Add block replace transformer_options to flux. 2024-11-12 08:00:39 -05:00
contentis
5599cf46c9 fix dynamic shape export (#5490) 2024-11-04 14:59:28 -05:00
comfyanonymous
d04f422dc6 Allow using SD3 type te output on flux model. 2024-10-03 09:44:54 -04:00
City
40dcc5a39f Flux torch.compile fix (#5082) 2024-09-27 22:07:51 -04:00
comfyanonymous
635eeda81f Indentation. 2024-08-17 23:00:44 -04:00
Xrvk
5811b93d32 Add Flux model support for InstantX style controlnet residuals (#4444)
* Add Flux model support for InstantX style controlnet residuals

* Refactor Flux controlnet residual step to a separate method

* Rollback minor change

* New format for applying controlnet residuals: input->double_blocks, output->single_blocks

* Adjust XLabs Flux controlnet to fit new syntax of applying Flux controlnet residuals

* Remove unnecessary import and minor style change
2024-08-17 22:58:23 -04:00
comfyanonymous
00545103df Revert "Not sure if this actually changes anything but it can't hurt."
This reverts commit f252a56d6ffbff643c86de4c7c5b0cf150535134.
2024-08-14 01:05:17 -04:00
comfyanonymous
f252a56d6f Not sure if this actually changes anything but it can't hurt. 2024-08-13 13:29:16 -04:00
comfyanonymous
e1e5903bec xlabs Flux controlnet implementation. (#4260)
* xlabs Flux controlnet.

* Fix not working on old python.

* Remove comment.
2024-08-12 21:22:22 -04:00
comfyanonymous
8e7aa23b6a ONNX tracing fixes. 2024-08-04 15:45:43 -04:00
comfyanonymous
a06d0ff763 Hack to make all resolutions work on Flux models. 2024-08-01 21:39:18 -04:00
comfyanonymous
30a15dd5e1 Better Mac support on flux model. 2024-08-01 13:10:50 -04:00
comfyanonymous
96dbbd23d8 Fix old python versions no longer working. 2024-08-01 09:57:20 -04:00
comfyanonymous
fc6a27f36c Basic Flux Schnell and Flux Dev model implementation. 2024-08-01 09:49:29 -04:00