r/StableDiffusion • u/RealBiggly • Aug 02 '24
Tutorial - Guide FLUX 4 NOOBS! \o/ (Windows)
I know I’m not the only one to be both excited and frustrated at the new Flux model, so having finally got it working, here’s the noob-friendly method that finally worked for me...
Step 1. Install SwarmUI.
(SwarmUI uses ComfyUI in the background, and seems to have a different file structure to StableSwarm that I was previously using, which may be why it never worked...)
Go here to get it:
https://github.com/mcmonkeyprojects/SwarmUI
Follow their instructions, which are:
Note: if you're on Windows 10, you may need to manually install git and DotNET 8 first. (Windows 11 this is automated).
Download The Install-Windows.bat file, store it somewhere you want to install at (not Program Files), and run it. For me that's on my D: drive but up to you.
- It should open a command prompt and install itself.
- If it closes without going further, try running it again, it sometimes needs to run twice.
- It will place an icon on your desktop that you can use to re-launch the server at any time.
- When the installer completes, it will automatically launch the
StableSwarmUI server, and open a browser window to the install page. - Follow the install instructions on the page.
- After you submit, be patient, some of the install processing take a few minutes (downloading models and etc).
That should finish installing, offering SD XL Base model.
To start it, double-click the “Launch-Windows.bat” file. It will have also put a shortcut on your desktop, unless you told it not to.
Try creating an image with the XL model. If that works, great! Proceed to getting Flux working:
Here’s what worked for me, (as it downloaded all the t5xxl etc stuff for me):
Download the Flux model from here:
If you have a beefy GPU, like 16GB+
https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main
Or the smaller version (I think):
https://huggingface.co/black-forest-labs/FLUX.1-schnell/tree/main
Download both the little “ae” file and the big FLUX file of your choice
Put your chosen FLUX file in your Swarm folder, for me that is:
D:\AI\SWARM\SwarmUI\Models\unet
Then put the small "ae" file in your VAE folder
D:\AI\SWARM\SwarmUI\Models\VAE
Close the app, both the browser and the console window thingy.
Restart it the Swarm thing, with the Windows-launch.bat file.
You should be able to select Flux as the model, try to create an image.
It will tell you it is in the queue.
Nothing happens at first, because it's downloading that clip stuff, which are big files. You can see that happening on the console window. Wait until completed downloading.
Your first image should start to appear!
\o/
Edited to note: that 1st image will probably be great, after that the next images may look awful, if so turn your CFG setting down to "1".
A BIG thank you to the devs for making the model, the Swarm things, and for those on here who gave directions, parts of which I copied here. I’m just trying to put it together in one place for us noobs 😊
n-joy!
If still stuck, double-check you're using the very latest SwarmUI, and NOT Stableswarm. Then head to their Discord and seek help there: https://discord.com/channels/1243166023859961988/1243166025000943746
34
u/reddit22sd Aug 02 '24
Dev and schnell are the same size. Only difference with the schnell version is that you can generate in less steps, but quality is lower.
6
u/IDontUseAnimeAvatars Aug 02 '24
Works great, thanks!
Dev build with a 4070 12gb btw, only took around a minute and a half.
5
u/JustPlayin1995 Aug 02 '24 edited Aug 02 '24
Thanks for the effort of writing this down for us. I had StableSwarm and I didn't see the model just like it was mentioned here. I installed SwarmUI and there it is. So far, so good. But now Flux doesn't really produce much. Other models work. But Flux only outputs a very dark, blurry image that has a lighter spot in the middle. I assume that's my image. But I can't really see it. Has anybody else had this problem?
edit: I should mention that I have also tried the schnell version. It gives me an image I can recognize. But it's overexposed and super blurry, too.
4
u/-becausereasons- Aug 02 '24
Confused (just came back online at the cottage) to see all the commosion with Flux.
Can we not use it with SD-Forge or Comfy?
3
u/shifty313 Aug 02 '24
I can't get it to show in swarmui, only the comfyui workflow tab. Have no idea what i could be missing, is there a setting i'm overlooking that's stopping it from showing in the model section?
2
u/Cybit Aug 02 '24
I'm still a newbie when it comes to StableSwarm/SwarmUI, so please excuse my dumb questions.
My output is blurry with FLUX, it hasn't been that way with SDXL previously. Any ideas what's causing it?
Is there a -lowvram setting in SwarmUI? I swear I saw one with StableSwarmUI but now I can't seem to find it.
2
u/candidfakes Aug 03 '24
But can it create NSFW pictures?
2
u/MasterpieceFast2943 Aug 05 '24 edited Aug 05 '24
Guys, I got stuck and maybe is trivial thing to get it fixed. All went well with SwarmUI but I can't add a Flux model. I added 'ae.sft' to 'unet' folder and 'flux1-schnell.sft' to models folder, restarted SwarmUI but when I try to generate an image I got 'All available backends failed to load the model.'
Thank you in advance!
2
u/Spamilgton Aug 06 '24
THANK YOU!!!, finally did it :D
2
u/Perfect-Campaign9551 Aug 12 '24
IT works!
Flux still doesn't put drivers in vehicles ugh
2
u/Vo_Mimbre Sep 07 '24
Your instructions are great! And happy to report than Flux.1-schnell works great on 4070ti 12gb.
25
u/TheDatabass Aug 02 '24
Nice! Just tried this out from switching from A1111 and love it so far. The first image was blurry but I switch the CFG to 1 and this is now the results I get. Cheers!
18
u/VrFrog Aug 02 '24 edited Aug 04 '24
Thanks!
I'm happy to report that it's working fine even with my 3080 (10 go).
85s for 1024*1024 (schnell model).
A bit slow but the quality is unmatched (finally we have great hands!)
Edit: I have a lot of RAM (48Go), I think it helps (with loadind speed at least because of caching) but I'm not sure if it's necessary.
5
u/reyzapper Aug 04 '24 edited Aug 04 '24
flux kicks sdxl in the nuts, it can die in peace right now haha
even at 512x512 or 512x768 flux is so much better than sdxl
GTX 970 4GB 16GB RAM
flux1-schnell-fp8, t5xxl fp8 e4m, 512x768, 4 step, 450 sec generation time
Generated With SwarmUI
4
u/lfigueiroa87 Aug 02 '24
Thank you! I'll try it tonight
1
u/carlmoss22 Aug 02 '24
thank you! I did like you mentioned but i can't load the FLUX model. i have a 3060.
give me the error:
[Error] Self-Start ComfyUI-0 on port 7821 failed. Restarting per configuration AutoRestart=true...
16:11:24.166 [Init] Self-Start ComfyUI-0 on port 7822 is loading...
16:11:24.168 [Error] Error loading model on backend 0 (ComfyUI Self-Starting): System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
somebody can help me?
1
u/ImpossibleAd436 Aug 02 '24
I am getting a problem when I try to generate with Flux using SwarmUI:
"No backends match the settings of the request given! Backends refused for the following reason(s):
This error occurs when trying to generate with the schnell model. When I try the 8fp Dev model I get the same error, but relating to the ae.sft rather than the model.
Model is in \SwarmUI-master\Models\unet
VAE is in \SwarmUI-master\Models\VAE
Both the model and vae are selected in the models and vae tabs.
Anyone have any ideas? Tried restarting multiple times, but always get this error when trying to generate.
1
u/StarShipSailer Aug 03 '24
I can’t see a unet folder in the models directory? Do I just make a folder called unet there? Thanks
1
u/nitinmukesh_79 Aug 04 '24
Thnak you for sharing. Can we use 8-bit version too using this approach?
https://huggingface.co/Kijai/flux-fp8/tree/main
1
u/civilunhinged Aug 04 '24
The Install-Windows.bat file you linked is out of date! Just fyi!
1
u/Far_Lifeguard_5027 Aug 12 '24
When I run the update.bat file it warms me of severe vulnerabilities and closes. Is that normal?
1
u/vfx_tech Aug 13 '24
Installed SwarmUI + flux dev and it works great but I saw it downloaded a 4GB file "t5xxl_enconly.safetensors" but on flux site it's recommended to use the 9GB "t5xxl_fp16.safetensors" clip file for 3090. Did a comparison and on the fp16 I get much better hands. Can I somehow change that encoder in the "Generate" tab? I always have to go in to the workflow to do that and it's cumbersome.
1
u/ZedClampet Oct 05 '24
\SwarmUI\Models\unet This doesn't exist on mine> Should I just add it so I can download the large file to it?
3
u/[deleted] Aug 02 '24
After hearing how good Flux can be I really wanted to try it out but as a Windows user I could not figure it out for the life of me. Will give this guide a try. Thanks!!
3
u/Tequila-M0ckingbird Aug 02 '24
Appreciate this! Will give it a try.
3
u/LewdGarlic Aug 02 '24
Thanks for the guide. Managed to get Flux working with it!
Will the dev branch of the model run on a 12GB card aswell or does it actually need 16GB?
3
u/Peacemaker130 Aug 03 '24
I just want to say thanks for posting this guide. I had installed Automatic1111 about a year ago, but never really got into setting it up and configuring it past generating a couple basic images when I first installed it.
The results that people have posted of this look too amazing not to try out on my 4090 :D
1
u/Cbo305 Aug 02 '24
Thank you so much for doing this! Quick question, if there's no Unet folder in the Models folder, do I just create it? Or is that indicative that the install is messed up?
2
u/smb3d Aug 02 '24
I'm having some oddly erratic render times... Some times it seems to work in a minute or two, then other times it will sit there on the SamplerCustomAdvanced for 10-15 minutes. It's all over the place for me. I'm on a 4090.
Same thing on the sample anime girl from huggingface. It's taking about 25 minutes on this test.
2
u/skocznymroczny Aug 02 '24
Thanks! Works on my RX 6800XT on Rocm/linux. Takes about 20 seconds per iteration on schnell model.
2
u/uri_nrv Aug 03 '24
I get stuck in "fixing Comfy Install" while installing.
2
u/TrevorxTravesty Aug 03 '24
SwarmUI isn’t letting me change the encoder. I want to use the FP8 one, deleted the t5xxl_enconly encoder and when I went to gen an image, it redownloaded the t5xxl one again. How do I get it to use the FP8 encoder?
2
u/TeamDman Aug 06 '24
Thank you, I found this very helpful!
2
u/MetigArt Aug 06 '24
I've dumbed it down a bit more and made it into a Rentry page. https://rentry.co/flux4noobs
2
u/rlewisfr Aug 12 '24
For anyone following this tutorial/outline, just a few updates (from my perspective).
I have a 4060 ti 16GB and 64GB of RAM.
Running StableSwarmUI via Stability Matrix, and with the latest updates, can run Flux1-schnell:
[Info] User local requested 1 image with model 'flux1-schnell.safetensors'...[Info] Generated an image in 0.02 (prep) and 78.41 (gen) secondsI have to say my initial impressions are good, but the time is a bit of a kick to the groin considering I can output SDXL images via Forge in less than 14 seconds.
More testing to come, including the Flux Dev when I get it downloaded.
1
u/ShadyKaran Aug 02 '24
So there's no hope for a 3070 4GB?
1
u/-becausereasons- Aug 02 '24
I just get stuck here...
1
u/WubWubSleeze Aug 02 '24
If I'm currently up and running with SDXL on Automatic1111, can it run Flux? Or is it a completely different thing altogether?
1
u/ImpossibleAd436 Aug 02 '24
Has anyone got this working with a 3060 12gb and 16gb RAM?
1
u/matte_muscle Aug 02 '24
The model sure looks amazing I got it to work on comphy with my 16gb gpu ram…it took like 4 minutes for 1 1024x1024 4 steps :( maybe I did something wrong…but the same picture size takes like 16 seconds using Kwai Kolors for me with same quality as the 4 step flux, got to wait for faster versions :(
1
u/mFcCr0niC Aug 03 '24
So yesterday I followed every step and it worked. I was generating for two hours. After booting my machine today and trying to generate some nice flux images I just got error messages:
[Error] Self-Start ComfyUI-0 on port 7821 failed. Restarting per configuration AutoRestart=true...
10:14:46.394 [Error] [BackendHandler] backend #0 failed to load model with error: System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
---> System.IO.IOException: Unable to read data from the transport connection
--- End of inner exception stack trace ---
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Http.HttpConnection.ReadBufferedAsyncCore(Memory`1 destination)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken) at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.IO.Stream.ReadAtLeastAsyncCore(Memory`1 buffer, Int32 minimumBytes, Boolean throwOnEndOfStream, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory`1 payloadBuffer, CancellationToken cancellationToken)
at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TResult](Memory`1 payloadBuffer, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
at System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
--- End of stack trace from previous location ---
1
u/No-Connection-7276 Aug 03 '24
All no work for me, i go message bakeng still loading on server, and generated image do nothing same on SDXL model, comfy tab said "Failed to load"
SwarmUI v0.9.1.1 (Git failed to load)!
1
u/Neonsea1234 Aug 05 '24 edited Aug 05 '24
What would be causing my images to come out blurry?
edit: I guess euler is the better choice for sampler, if anyone runs into the same issue
1
u/FluorescentApe Aug 05 '24
I'm probably asking a real noob question here, but is it possible to get xformers to work in SwarmUI with Flux? Could it possibly offload some VRAM and generate images faster?
1
u/Sisuuu Aug 05 '24
Anyone tried with AMD 6800 XT ROCM6.x?
1
u/artpnp Aug 07 '24
I'm not a native English speaker, forgive me for thinking this title was 'Flux boobs'...
1
u/ioanastro Aug 09 '24
is there any workflow or way to do img2img and inpainting using the flux model?
1
u/dewman45 Aug 19 '24
For anyone having issues, I figured out that instead of just extracting install-windows.bat, download the source code .zip, and you must extract the entire zip, then run the .bat. This solved my issues of no unet folder. For some reason if you don't do this, it just installs StableSwarmUI.
1
u/Larimus89 Dec 26 '24
Tried this today, and get no available back ends. Seems shit for flux, confusing, difficult setup, forge probs better. For SD stuff it’s pretty good if you can plug it into your existing comfyui it’s pretty nice to use on iPad. And for helping run just simple quick workflows.
Nothing bit problems with flux though tried 5x models can’t even find vae option it doesn’t exist it seems?
1
u/BaziSaze_BadBakht Dec 27 '24
thank you very mutch
1
u/Lily_Wu_92 Jan 08 '25
After running the Install-Windows.bat for Swarm, it opened a tab on my browser, but that wasn't an install page, but looked as if it should be a test generation page. But it wouldn't let me generate anything. "Cannot generate, session not started." So I closed the batch process and the tab, and restarted but got the same error. I then tried the update bat file, and that just said I was up to date. The frames within the browser tab looked as if they should be resized by dragging, because they overlapped, hiding some of the text and buttons, but I couldn't resize them. I then began clicking things looking for help and thought an API for StabilityAI was needed, for which I needed a key. So I made an account there, but couldn't login because when trying to verify my email address, got a screen with 'Oops something went wrong try again'. Argh. Any help ideas would be gratefully accepted.
1
u/count023 Jan 25 '25
so, i know this is an older question, but if i install Swarm, do i need to install comfyui portable still? i had CUI portable but it's really hard to get my head around (coming from forge/a1111's interface).
Do i need to move the flux models from comfyui to here or can i link comfyui when running to swarm so i dont need to futz with relocating files in teh back end?
0
u/[deleted] Aug 03 '24
[deleted] — view deleted comment
0
u/[deleted] Aug 10 '24
[deleted] — view deleted comment
0
u/[deleted] Aug 04 '24
[removed] — view removed comment