59 Commits
Author SHA1 Message Date
Jonas Müller 802fb47139 FLUX.1 Krea Release 2025-07-31 15:29:34 +02:00
Jonas Müller 1371b2bc70 Fix link in docs 2025-07-01 21:11:13 +02:00
Jonas Müller 474dc42053 Update License 2025-06-27 18:20:34 +02:00
timudk 57ce405190 Kontext release 2025-06-26 08:10:08 -07:00
Seas0 72cf7f9511 fix typo in layers.py (#446)
fix typo in layers.py
2025-06-24 22:58:24 -07:00
Sven Killig 3c13d8d4ed fix typo in structural-conditioning.md (#440) 2025-06-05 17:54:50 +02:00
Tim Dockhorn 716724eb27 Update README.md 2025-02-06 13:48:48 -08:00
Tim Dockhorn 7c293937f5 update docs 2025-02-04 18:07:34 -08:00
Tim Dockhorn af9d2f0df9 fix trt support (#410) 2025-01-31 10:47:03 -08:00
434306193e Add trt support for BF16 (#195)
* fix interface of `get_sample_input`

* save configuration parameters

* ae wrapper implemented

* fix import

* add AEWrapper step

* from set_model_to_dtype to prepare_model

* fix eval mode during inference

* fix clip onnx export. Now it trace ony the needed outputs

* fix t5 wrapper

* reorder input name flux

* fix flux input format for text_ids and guidance

* fix Flux imports and scale of inputs to prevent nan
added `"latent": {0: "B", 1: "latent_dim"}` as additional dynamic axes

* add torch inference while tracing

* fix casting problem in onnx trace

* solve optimization problem by removing cleanup steps

* rename to notes

* prevent nan due to large inputs

* provide base implementation of `get_model`

* format

* add trt export step

* add engine class for trt build

* add `get_input_profile` and `get_minmax_dims` abstract methods

* add `build_strongly_typed` attributed

* implement `get_minmax_dims` and `get_input_profile`

* remove `static_shape` from `get_sample_input`

* remove static sharpe and batch flags

* add typing

* remove static shape and batch flags

* offload to cpu

* enable device offloading while tracing

* check cuda is avaiable while building engines

* clip trt engine build

* add pinned transformer dependency

* fix nan with onnx and trt when executed on CUDA

* AE need to be traced in TF32 not FP16

* add `get_shape_dict` abstract method and  device as a property

* AE should be traced in TF32

* AE explicitly on TF32 and reactivate full pipeline

* add input provile to flux to enable trt engine build

* format and add input_profile to t5 for TRT build

* add `TransformersModelWrapper`

* add TransformersModelWrapper support

* add `get_shape_dict` interface

* add TransformersModelWrapper support

* add shape_dict interface

* t5 in TF32 for numerical reasons

* remove unused options

* remove unused code

* add `get_shape_dict`

* remove custom optimization

* add garbage collector

* return error

* create wrapper specific to Onnx export operatio

* user OnnxWrapper

* create base wrapper for trt engines

* moved to engine package

* moved to engine package

* forbit relative import of trt-builder

* remove wrapper and create BaseExporter or BaseEngine

* models not stored in builder class

* _prepare_model_configs as pure function

* _get_onnx_exporters as a private method to get onnx exporters

* remove unused dependencies

* from onnxwrapper to onnxengine

* trt engine class

* add `calculate_max_device_memory` to TRTBuilder

* `get_shape_dict` moved to trt-engine interface

* add common inference code

* autoencder inference wrapper

* add requirements.txt

* support guidance for ev model

* ad support for trt based on evn variables

* format flux

* remove stream from constructor

* fix iterate over onnx-exporters

* flux is not strongly type

* move back for numerical stability

* add logging

* fix dtype casting for bfloat16

* fix default value

* add version before merge

* hacky get it building the engines

* requirements.txt

* adding a seperate _engine.py file for all the flux, t5 and clip engine

* boilerroom and plating. getting parameters handle into setting up the trt engines

* remove _version.py from git

* create base mixin class to share parameters

* clipmixin parameters

* remove parameters as are part of mixin class

* clip engine and exporter use common mixin for managing parameters

* use mixin cass to build engine from exporter

* ae-mixin for shared parameters

* flux exporter and engine unified by mixin class

* formatting

* add common `get_latent_dims` method

* add `get_latent_dims` common method

* T5 based on mixin class

* build strongly typed flux

* enable load with shared device memory

* remove boilderpart code to create engines

* add tokenizer to trt engine

* use static shape for reduce memory consumption

* implemnet tokenizer into t5 engine

* mix max_batch size to 8

* add licence

* add licence

* enable trt runtime tracking

* add static-batch and static-shape options

* add cuda steam to load method

* add inference code

* add inference code

* enable static shape

* add `static_shape` option to reduce memory and `_build_engine` as staticmethod

* add `should_be_dtype` filed to handle output type conversion

* from trtbuilder to trt_manager

* from TRTBuilder to TRTManager

* AE engine interface

* `trt_to_torch_dtype_dict` as property

* clip engine inference

* implement flux trt engine inference process

* add scale_factor and shift_factor

* removed `should_be_dtype`

* removed `should_be_dtype`

* remove `should_be_dtype` from t5

* add scale and shift factor

* `max_batch` to 8

* implement `TRTManager`

* from ae to vae to match DD

* remove autocast

* `pooled_embeddings` to match DD naming for clip

* rename `flux` to `transformer` engine

* from flux to transformer mixin

* from flux to transforemer exporter

* fix trtmanger with naming

* fix inputs names and dimentions. Nota that `img_ids` and `txt_ids` are without batch dim

* fix shape of inputs according to `text_maxlen` and batch_size

* reduce max_batch

* fix stage naming

* add support for DD model

* add support for DD models

* fix dtype configuration

* fix enginge dtype

* trensformers inference interface to match DD

* vae inference script dtype mapping

* remove dtype checks as multiples can be actives

* by default tf32 always active

* fix trt enginges names

* add wrapper for fluxmodel to match DD onnx configuration

* add autocast back in to match DD setup

* fix dependencies for trt support

* support trt

* add explicit kwargs

* vscode setup

* add setup instructions for trt

* `trt` dependencies not part of `all`

* from onnx_exporter to exporter

* hide onnx parameters

* from onnx-exporter to exporter

* exporter responsible to build trt engine and onnx exportr

* hide onnx parameter

* remove build function from engine class

* remove unused import

* remove space

* manage t5 and vae separately

* disable autocast

* stronglytyped t5

* fix input type and max image size

* max image size

* T5 not strongly typed

* testing

* fix torch sycronize problem

* don't build already present engines

* remove torch save

* removed onnx dependencies

* add trt dependencies

* remove trt dependencies from toml

* rename requirements and fix readme

* remove unused files

* fix import format

* remove comments

* add gitignore

* reset dependencies

* add hidden setup files

* solve ruff check

* fix imports with rufs

* run ruff formatter

* update gitignore

* simplify dependencies

* remove gitignore

* add cli formatting

* fix import orders

* simplify dependencies

* solve vae quality issue

* fix ruff format

* fix merge changes

* format and sort src/flux/cli

* fix merge conflicts

* add trt import

* add static shape support (not completed)

* remove fp8 support

* add static shape

* add static shape to t5

* add static shape to transformer

* remove model opt code

* enable offloading with trt engines

* add `stream` as part of `init_runtime`

* enable offloading

* `allocate_buffers` moved to call

* formatting

* add capability to compute `img_dim`

* enable dynamic or static-shape

* split base-engine and engine class

* clip as engine

* t5 as engine

* transformer as engine

* VAEDEcoder as engine and VAEEngine as BaseEngine

* from vae to vae_decoder, vae_encoder and vae

* use `set_stream` and fix activate call

* fix import and remove stages in TRTManager

* from BaseEngine to BaseEngine and Engine

* fix imports

* add trt support to cli_controlnet

* add vae_encoder to support controlnet

* refactor vae engine to use load() and activate() functions

* implement vae_encoder_exporter. Not tested

* fix imports

* add static_batch and static_shape to cli.py as additional option ?

* update dependencies

* revert formatting

* from Self to Any to be compatible with pytorch 3.10

* from `vae_decoder` to `vae` for compatibility with oss engines

* missing torch import

* add `scale_factor` and `shift_factor` to VAE-encoder

* add check if vae is traced

* offload while tracing

* default `text_maxlen` set to dev size instead of schnell

* remove line

* add warnign when text_maxlen is not read from t5

* fix imports

---------

Co-authored-by: scavallari <[email protected]>
Co-authored-by: ahohl <[email protected]>
2025-01-31 10:39:12 -08:00
automan d06f82803f Update cli_fill.py (#396)
offload to cpu
2025-01-09 14:54:47 -08:00
Junjie 4c3e53f03e Fix param name error in fill docs (#394) 2025-01-09 14:54:25 -08:00
Jake Roggenbuck 71b140327c Change spelling in readme (#397) 2025-01-09 14:53:52 -08:00
Tim Dockhorn 6cd49f5bb1 remove conda instructions 2025-01-09 14:53:23 -08:00
Eric Hao 99e2286591 fix: correct link in readme (#393)
* fix: correct link in readme

* docs: add conda scripts

* docs: format readme
2025-01-09 14:52:33 -08:00
Sayak Paul 98023b5e6e Update structural-conditioning.md to include a diffusers note (#395) 2025-01-09 14:48:18 -08:00
Tim Dockhorn 140cbfb886 Update README.md 2024-12-31 12:25:00 -05:00
Tim Dockhorn ef44339c1c Update README.md 2024-12-31 12:23:42 -05:00
Tim Dockhorn 805da8571a FLUX Tools 2024-11-21 06:55:30 -08:00
Tim Dockhorn 7e14a05ed7 Ruff ci (#194)
* apply ruff

* rename

* specify ruff version for CI

* also check imports

* check formatting
2024-11-14 13:00:44 -08:00
Tim Dockhorn 478338d527 update readme for 1.1 2024-10-07 17:25:00 -07:00
Emil SadekandEmil Sadek c0e2ac69e5 Remove unused import and extraneous f prefix (#171)
* Remove unused import

* Remove extraneous `f` prefix

---------

Co-authored-by: Emil Sadek <[email protected]>
2024-10-07 17:04:27 -07:00
Tim Dockhorn 01ff622c9b Update README.md 2024-10-07 17:02:57 -07:00
Tim Dockhorn ca98d5e99c Update README.md 2024-10-07 16:19:09 -07:00
Thibaut d219f1aed9 CLI: /n is for steps, not seeds (#169) 2024-10-03 16:31:21 +02:00
Jonas Müller 58263351cd Update API interface for FLUX.1.1 [pro] 2024-10-03 16:28:57 +02:00
Neil MovvaandNeil Movva 87f6fff727 Add Torch CUDA sync to fix timing code in cli.py (#147)
Co-authored-by: Neil Movva <[email protected]>
2024-09-13 11:47:16 +02:00
Zeke Sikelianos d013dc4d3f Add link to fine-tunes collection on Replicate (#130)
https://replicate.com/collections/flux-fine-tunes
2024-08-29 13:56:03 -07:00
TJKDev1 b4f689aacc Fixed typo in sampling.py (#114) 2024-08-21 14:49:58 -07:00
Andrei Filatov 44e9ce9f81 fix typo in util.py (#66) 2024-08-21 11:41:42 -07:00
Tim Dockhorn 23dc6c7b8e fix indexing (#113) 2024-08-21 11:40:28 -07:00
Emad Bagheri 33a24ac8ec Update README.md (#78)
On windows single quotation gives error. 
Replaced it with double quotation.
2024-08-21 11:16:35 -07:00
Tim Dockhornandchevisha 1375269e82 Add device for nsfw model (#112)
* added device=device for nswf model

* fix device

---------

Co-authored-by: chevisha <[email protected]>
2024-08-21 11:14:57 -07:00
omahs ca3ea238f8 fix minor typos (#69)
* fix typo

* fix typo
2024-08-21 10:09:37 -07:00
Dr. Artificial曾小健 3286449dd7 fix (#110)
fix
2024-08-21 10:09:06 -07:00
Paul CJ Hetherington c00d7c60b0 Add Mystic as an inference partner (#93)
* Add mystic as an inference partner

* Update README.md
2024-08-16 16:34:35 +02:00
Cody Brownstein c23ae24722 Fix typo (#56) 2024-08-08 08:49:10 +02:00
jenuk 7ba056e5f7 Update model locations on huggingface 2024-08-06 14:08:48 +02:00
Matteo Ferrando 206c4d3441 fix: correct link to fal.ai playgrounds (#43)
* fix: correct link to fal playground

* schnell too
2024-08-05 18:58:54 +02:00
Jonas Müller ae39e91c4a Merge pull request #18 from apolinario/main
Add a gradio demo and diffusers code reference
2024-08-05 13:47:16 +02:00
apolinário 79b405e82e add output 2024-08-05 05:11:13 -05:00
Jonas Müller 432c885d56 Merge pull request #27 from deforum/patch-1
there is a .to() without a target
2024-08-05 10:58:32 +02:00
multimodalart abf930ea9e oops, no png 2024-08-03 11:50:40 +03:00
multimodalart e43ae0fda0 Add further comments + fixes 2024-08-03 11:47:50 +03:00
multimodalart 618e64acee apply review changes 2024-08-03 11:21:18 +03:00
deforum 6349712075 there is a .to() without a target 2024-08-02 19:05:08 -07:00
Tim Dockhorn 727e3a71fa Merge pull request #22 from black-forest-labs/fix-streamlit-step-modulation
Fix the step modulation in streamlit
2024-08-02 17:50:09 +02:00
jenuk c08126a7af Fix the step modulation in streamlit 2024-08-02 17:45:06 +02:00
apolinárioandJonas Müller e2ca0de6c2 fix shape
Co-authored-by: Jonas Müller <[email protected]>
2024-08-02 10:32:41 -05:00
apolinário 6d2a00f3b7 fix conflict 2024-08-02 08:38:50 -05:00