5 min read

August 2024: Flux Support, New Frontend, For Loops, and more!

August 2024: Flux Support, New Frontend, For Loops, and more!

Team Focus

We've spent a good part of the last couple months here at Comfy Org speaking with the community online and at events, as well as discussing internally with our team, about our most important priorities and focuses for advancing ComfyUI. We're happy to share that we are now taking rapid action on those priorities. We are working faster than we ever have before and intend to continue accelerating. You'll see the first results of this below - most of the biggest changes we're announcing here are methods to accelerate development pace (such as the better frontend codebase), unlock new tools (such as the execution inversion PR), and better ensure we can update ComfyUI without breaking extensions (such as the release version system). In the coming future we'll also post more about other work in this direction such as automated testing (CI) and more.

Through this prioritized and organized work, we hope to rapidly turn ComfyUI to the ultimate open source solution for AI Image Generation (and beyond).

Release Versions

As announced in our previous blog post, we've begun creating weekly release versions of ComfyUI, which you can view here. Today we have released v0.0.4, the fourth stable release version. Production deployments of ComfyUI should stick to the stable release versions.

Flux

The new model Flux.1 from Black Forest Labs, a new company led by the original creators of Stable Diffusion, was announced with day-1 support in ComfyUI and SwarmUI! This includes two models: Flux.1-Dev, a guidance-distilled high quality model, and Flux.1-Schnell, a faster (but lower quality) step-distilled ("Turbo") model. These models are both much smarter and higher quality than any other foundation model ever released to the public thus far.

You can get example workflows here, and download simple fp8 checkpoints for Flux.1-Schnell here, or Flux.1-Dev here, or download the original fp16 files from BFL's HF page.

Note for both models you can either use SamplerCustomAdvanced with BasicGuider, or if you use KSampler, set CFG to 1. You can use the new FluxGuidance on the Dev model to control the distilled CFG-like value. (Setting this to 2 is recommended for realism or better style control) These models are trained to work without real CFG. That's not to say you can never use CFG though - in fact, the community has rapidly taken advantage of ComfyUI as an experimentation platform to test out a wide variety of tricks to get the most out of the new models. (Such as using the Dynamic Thresholding custom node, or using the new FluxGuidance built-in node to compensate, and enable CFG and negative prompting. There's also ModelSamplingFlux built in to control Flux sigma shift, though its benefits are more limited.) This powerful rapid experimentation is what caused many of us to first fall in love with ComfyUI, so we're very excited to enable it for a new generation of models once again.

Flux is also the biggest open model released - at 12 Billion Parameters, the original file weighed 23 gigabytes! So how are we running that on normal consumer hardware? ComfyUI supports loading model weights directly in FP8 format (12 gigabytes), and automatically detects available VRAM to swap loading method. (Do you have less than 12 gigs of VRAM? Worry not, Comfy's core model handler will detect this and automatically offload VRAM partially to system RAM, allowing the model to run on smaller GPUs at the cost of slightly slower running times.)

Final Flux tip for now: you can merge the Flux models inside of ComfyUI block-by-block using the new ModelMergeFlux1 node. For example, save this image and drag it onto your ComfyUI to see an example workflow that merges just the Flux.1-Dev double_blocks (MM-DiT) onto Flux.1-Schnell, giving you a higher quality model that still runs in just 4 steps!

Hunyuan DiT

The Hunyuan DiT models from Tencent are also now supported in ComfyUI. You can get an example workflow here, and safetensors copies of the models from here.

It is our goal for ComfyUI to support all the latest-n-greatest AI Image models, and so we are proud to have worked directly with the original Hunyuan team to integrate their models directly, just as we worked with the Flux team and also recently the AuraFlow team.

Hunyuan DiT is notably good at understanding Chinese prompts, and has a wide range of bonus features developed by Tencent (controlnets, multi-turn conversation generation, etc.) (some of these features are still in-development for ComfyUI).

New Frontend

On August 15th, we will be replacing the legacy JavaScript frontend with the new TypeScript frontend, which you can see here.

Why a New Frontend? Our current frontend is built using vanilla JavaScript ESM modules without package management, which has led to significant challenges in development. We've been reinventing solutions for problems that already have established, efficient answers. The new frontend leverages TypeScript, Vue, and Vite, offering a more robust and maintainable codebase. We've also developed a custom shim extension in the Vite build process to ensure full compatibility with our existing frontend extension ecosystem. This new tech stack will dramatically accelerate the development of new frontend features.

View more information about our transition plan here.

Thanks to HCL for leading the charge on the new frontend!

PR 2666 (Execution Inversion)

PR 2666, "Execution Model Inversion", (aka the PR that adds the core engine necessary for things like in-workflow for loops), will be merged Next Week! This is final public notice to please test this PR ASAP! If you are a nodepack author, especially if your pack monkeypatches the core or touches complex execution logic, please test compatibility. We're hoping for a smooth merge that doesn't break anything for anyone here.

What does this mean for regular users? Initially, if all goes well: Nothing! Everything should continue to work exactly the same as it does.

In time: this opens up a much more powerful core execution engine that custom node authors can take advantage of, and then in turn workflow authors can use to make much more complex workflows.
Guill has a demo pack here you can use to test.

Thanks to guill for working so hard on this PR!

Here's a couple gifs showing loops and list accumulations, two examples of features only possible after this PR is merged: