Archived because deprecated
The base principle was simply to reuse the same noise seed for the refiner.
If you appreciate this contribution and would like to support future developments, feel free to check my ko-fi !
Introducing the SDXL-dedicated KSampler Node for ComfyUI
Hello ComfyUI enthusiasts,
I am thrilled to introduce a brand-new custom node for our beloved interface, ComfyUI. Designed to handle SDXL, this ksampler node has been meticulously crafted to provide you with an enhanced level of control over image details like never before.
Traditionally, working with SDXL required the use of two separate ksamplers—one for the base model and another for the refiner model. However, with the new custom node, I've combined the functionality of these two ksamplers into a single unit. This node not only manages both the base and the refiner models of SDXL, but it also handles the noise necessary for generating the images.
What does this mean for you? Precision. With this custom node, you can control noise levels with an unprecedented level of detail, leading to more nuanced and compelling outputs. The node is also integrated with a function to rescale the tonemap courtesy of the original developer, comfyanonymous, allowing a higher CFG scale to be used.
To integrate the noise control functionality, I've used functions developed by BlenderNeko. His brilliant work on noise control can be found on his Github page.
This SDXL-dedicated ksampler node is a labor of love, designed to streamline your creative process and elevate your outputs. I believe that tools should work for the user, not the other way around, and this custom node aims to do exactly that.
You can get started with the node on ComfyUI's Github page.
If you appreciate this contribution and would like to support future developments, feel free to visit my Buy Me a Coffee page. Any support goes a long way in fueling my efforts to continue enhancing our creative journey.
Let's continue making ComfyUI even better, together.
To creativity and beyond!
edit: added workflows to the archive!
Description
FAQ
Comments (46)
thanks a ton, was waiting for something similar, since realistic skin details are difficuilt to achive
How do I use this? Can I get an explanation please :)
Scratch that, i figured out how to install it but is there a way to make it so it doesn't require the refiner? because i use hires fix
@ptrprkr Hello!
I'm glad to hear that you've successfully installed the node. At the moment, the custom ksampler node is specifically designed to work with both the base (or any SDXL base model) and the refiner model to ensure a high level of detail.
I understand that the requirement for the refiner might not fit all workflows, especially if you're using hires fix. Unfortunately, as of now, the node doesn't support upscalers.
That being said, your feedback is valuable and the idea of implementing support for upscalers in the future is an interesting one! I'll definitely consider it.
It would be great if you include in the description some instructions on how to install it. And also if you provide a example for a workflow either an example .PNG or .JSON
To install you drop the .py on the custom_nodes folder
You're absolutely right about the installation and thank you for your suggestion! I'm planning to share more detailed instructions and usage examples in the upcoming days. Meanwhile, feel free to explore the gallery for some insights on its use.
Added two workflows in the archive! Thanks for the feedback!
This has streamlined my workflow considerably and the results... mind-blowing. This is a game-changer for anyone working with SDXL. A big shout-out to the developer for this brilliant addition to ComfyUI! Looking forward to seeing more of such innovative tools. 🙌💯
Hi, I currently have the problem that I don't know how to find the nodes in the selection. Is there any help for this? I copied the node to custom nodes. but where can i find him? thanks for the work
You can find it in the sampling>KSamplerSDXLAdvanced
After putting the .py file in your custom nodes folder (first time requires a restart)
Hi, result looks great but I was wondering about img2img... if there is no denoise setting how to control the influence of my original (latent image) input?
Hello! I generally raise the starting step at something above 0 :)
I got it!
I'm getting a console error on startup that it can't import extremedetail because it doesn't have an __ini_ file?
oops, just pulled the .py file out of the folder and that worked. I guess you can't drop a folder into the custom nodes folder unless that has the ini file in it, but one node by itself is okay.
Great node! I'm having good results with it, except that I cannot seem to replicate the denoising that is typically used for img2img and "hr fix". I've tried adjusting the start_at_step but the resulting image is pretty blurry. Could I be missing something?
Thank you for the sampler!
May I ask you for a bit of a mod? Some SDXL checkpoints do not require refiner. So that it would be great to add another option such as "refiner_strength".
or somehow bypass the refiner. I'm a noob so I'm wondering how to do this too
Results are baffling. 👍
Another thing I've noticed.... If I set refiner steps above 0, the results are actually blurrier than I'd expect. I've about given up on the refiner altogether.
Have you tried the example workflows? With the current implementation my node gives a black image if you set the refiner steps at 0.
I get black images when detail level is 0 (but not refiner). So what would the approach be if I do not want to use the refiner at all? Just not load the model in? I don't like refiner most of the time, but want to use your detail functionality.
@entmike2 You can always plug any model instead of the refiner if you want!
@extraltodeus Really? Interesting.... I will give that a try. Thanks for the very nice node!
Great work but what is the license of this? It is based on BlenderNeko's work that is GNU GPL so I guess this must be as well. Please post it on github together with accompanying license! thanks
Is there a sampler like this with detail level for just SD1.5 use?
It works with 1.5 models too, just hook up a correct VAE!
Just think how cool it would be if you included some instructions on how to install this. Unzipping it in the custom nodes folder doesn't work. . .
putting the .py file in the custom nodes folder actually works. It's in the samplers menu.
@extraltodeus HI I have put the folder I downloaded here into the Custom Nodes folder but the Ksampler sdxl node remains red!
@extraltodeus This worked, thank you bro.
hello, if it is not too much trouble, could you send me a detailed guide to install this node ? I am a beginner, because I added the file to custom nodes but the configuration does not appear in the interface.
hi guys,i tried it but can't find the ksamplersdxladvanced only KsamplerSDXL , any advice ?
謝謝你, 我建構出來了.
What settings are appropriate when doing i2i?
A version with denoise to increase detail of a pre-existent image would be great
This is my favorite sampler. When drawing single person images, it can provide unparalleled details, but after updating ComfyUI today, it encountered the following error:
Error occurred when executing KSamplerSDXLAdvanced:
'SDXL' object has no attribute 'get_model_object'
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ execution. py", line 151, in recursive_execute
Output_data, output_ui=get_output_data (obj, input_data-all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ execution. py", line 81, in get_output_data
Return_values=map_dode_over_list (obj, input_data-all, obj. FUSION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ execution. py", line 74, in mapynode-over_list
Results. append (getattr (obj, fun)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ custom nodes \ ksampler_sdxl. py", line 257, in sample_sdxl
Noisy_base=self. compute and generate invoice (latent_image, seed, width, height, batch_size, model_model, sampler, scheduler, base_end-at, base_startat, base_end-at, noise_source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ custom_dodes \ ksampler_sdxl. py", line 223, in computed-and_generate-noise
Sigma_balls=self.calc_sigma (model, sampler, scheduler, total_steps, start_at, end.at)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ custom nodes \ ksampler_sdxl. py", line 156, in calc_sigma
Sampler=comfy. samplers KSampler (real_model, steps=steps, device=device, sampler=sampler-name, scheduler=scheduler, denoise=1.0, model-options=model. model-options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ comfy \ samplers. py", line 705, in init
Self. set_steps (steps, denoise)
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ comfy \ samplers. py", line 726, in set_steps
Self. sigmas=self. computate_sigmas (steps). to (self. device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ ComfyUI \ comfy \ samplers. py", line 717, in calculateSigmas
Sigmas=calculate_sigmas (self. model. get_model_object ("model_sampling"), self. scheduler, steps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "H: \ ComfyUI_windows \ ComfyUI_20240128 \ ComfyUI_windowsuportable \ python_embedded \ Lib \ site packages \ torch \ n \ modules \ module. py", line 1688, in getattr_
Raise AttributeError (f "{type (self). name_} 'object has no attribute' {name} '")
Actually it is broken with error 'SDXL' object has no attribute 'get_model_object'.
File "ComfyUI/custom_nodes/ksampler_sdxl.py", line 257, in sample_sdxl noisy_base = self.compute_and_generate_noise(latent_image,seed,width,height,batch_size,model_model,sampler,scheduler,base_end_at,base_start_at,base_end_at,noise_source) File "ComfyUI/custom_nodes/ksampler_sdxl.py", line 223, in compute_and_generate_noise sigma_balls = self.calc_sigma(model,sampler,scheduler,total_steps,start_at,end_at) File "ComfyUI/custom_nodes/ksampler_sdxl.py", line 156, in calc_sigma sampler = comfy.samplers.KSampler(real_model, steps=steps, device=device, sampler=sampler_name, scheduler=scheduler, denoise=1.0, model_options=model.model_options)Everyone having issues: copy and paste just the .py into the custom_nodes folder, nothing else.
edit: even after getting it imported its broken with the same error Anyeos mentioned.
For those having an issue with the 'SDXL' object has no attribute 'get_model_object' issue, I found a possible fix. Line 156, change :
sampler = comfy.samplers.KSampler(real_model, steps=steps, device=device, sampler=sampler_name, scheduler=scheduler, denoise=1.0, model_options=model.model_options)
to
sampler = comfy.samplers.KSampler(model, steps=steps, device=device, sampler=sampler_name, scheduler=scheduler, denoise=1.0, model_options=model.model_options)
I found this fix by comparing it to a newer version of the calc sigma function line 43.
https://github.com/ExponentialML/ComfyUI_ELLA/blob/main/ella.py
the attribute "real_model" in the comfy.samplers.KSampler definition was the issue, you need to rename it to "model" instead.
Also, I had to recreate a Save Image node to see the final output. Hope it will help you guys.
And of course many thanks to you extraltodeus for this amazing node !!!
When using this I get the following RuntimeError: mat1 and mat2 shapes cannot be multiplied (154x2048 and 1280x768)
Hi, 👇👇👇❌
Could you please add Ksampler-Advanced to Comfy Manager? We can’t add custom nodes in the cloud.
Once it’s in Comfy Manager, we can use it. Is this possible mate?
Thanks!
+1. Also, maybe host it on Github? It'll make updating and stuff a lot easier.
Seems to be broken at the moment:
'SDXL' object has no attribute 'get_model_object'
Details
Files
Available On (1 platform)
Same model published on other platforms. May have additional downloads or version variants.









