Searge-SDXL: EVOLVED v4.3.2
Version 4.x is here.
I made a convenient install script that can install the extension and workflow, the python dependencies, and it also offer the option to download the required models.
Please read the install instructions in the readme file for more information about the install script and how to use it.
Description
Some custom nodes for ComfyUI and an easy to use SDXL 1.0 workflow. A detailed description can be found on the project repository site, here: Github Link
Installing
Detailed install instruction can be found here: Link to the readme file on Github
Usage Notes
The workflow is in the workflow folder, please load it from the JSON files to make sure you are using the latest versions of it.
The images in the examples folder have workflows embedded.
How to use this workflow
Here is an amazing Youtube video that Nerdy Rodent made about version 3.4 of the workflow. Many things have changed in v4.0 but the basics still apply. And while you are watching it, don't forget to subscribe to the channel.
Link to the Nerdy Rodent video
Updates
What's new in v4.3.2?
This is a minor update to make the workflow and custom node extension compatible with the latest changes in ComfyUI.
What's new in v4.3.1?
This is a minor update to make the workflow and custom node extension compatible with the latest changes in ComfyUI.
What's new in v4.3?
This update added support for FreeU v2 in addition to FreeU v1.
New Features
Support for FreeU v2 has been added and is included in the v4.3 workflow
Added more presets for FreeU and a selector to switch between v1 and v2
Updated the example images to embed the v4.3 workflow
What's new in v4.2?
This update contains bug fixes that address issues found after v4.0 was released.
Bug Fixes
A recent change in ComfyUI conflicted with my implementation of inpainting, this is now fixed and inpainting should
work again
New Features
Support for FreeU has been added and is included in the v4.2 workflow
Note: the images in the example folder are still embedding v4.1 of the workflow, to use FreeU load the new
workflow from the.jsonfile in theworkflowfolder
What's new in v4.1?
This update contains bug fixes that address issues found after v4.0 was released.
Bug Fixes
The high resolution latent detailer was not properly set up in the processing pipeline and did nothing
The debug printer node was broken - I didn't notice that because it was not connected in any of the v4.0 workflows
A bug related to generating with batch sizes larger than 1 has been fixed, it's now working properly
Other Changes
The images in the
examplesfolder have been updated to embed the v4.1 workflow
What's new in v4.0?
A complete re-write of the custom node extension and the SDXL workflow
Highly optimized processing pipeline, now up to 20% faster than in older workflow versions
Support for Controlnet and Revision, up to 5 can be applied together
Multi-LoRA support with up to 5 LoRA's at once
Better Image Quality in many cases, some improvements to the SDXL sampler were made that can produce images
with higher qualityImproved High Resolution modes that replace the old "Hi-Res Fix" and should generate better images
... many more things, too many to mention them all here
Description
In v4.2.1 an issue was fixed with generating images when no refiner is specified.
What's new in v4.2?
This update contains bug fixes that address issues found after v4.0 was released.
Bug Fixes
A recent change in ComfyUI conflicted with my implementation of inpainting, this is now fixed and inpainting should
work again
New Features
Support for FreeU has been added and is included in the v4.2 workflow
Note: the images in the example folder are still embedding v4.1 of the workflow, to use FreeU load the new
workflow from the.jsonfile in theworkflowfolder
FAQ
Comments (19)
Hi, I'm getting this error message. Please help. Thanks
Error occurred when executing SeargeMagicBox: 'NoneType' object has no attribute 'model' File "Y:\ComfyUI\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "Y:\ComfyUI\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "Y:\ComfyUI\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "Y:\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL\modules\magic_box.py", line 269, in process (data, stage_result) = self.run_stage(stage, data, stage_input) File "Y:\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL\modules\magic_box.py", line 248, in run_stage (data, stage_result) = stage_processor.process(data, stage_input) File "Y:\ComfyUI\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_load_checkpoints.py", line 140, in process refiner_model = NodeWrapper.freeu.patch(refiner_model, b1, b2, s1, s2)[0] File "Y:\ComfyUI\ComfyUI\comfy_extras\nodes_freelunch.py", line 40, in patch model_channels = model.model.model_config.unet_config["model_channels"]
I figured it out. For the refiner checkpoint, I can't leave it "none" like before
I reinstalled redownloaded twice. even tried with manager.
started with new comfyui release unzipped.
then normal git pull in node folder.
Then i get red boxes telling me none of the nodes work when i load workflow. and this in the cmd window.
Traceback (most recent call last): File "C:\comf\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1725, in load_custom_node module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in callwith_frames_removed File "C:\comf\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL__init.py", line 35, in <module> from .searge_sdxl import SEARGE_CLASS_MAPPINGS, SEARGE_DISPLAY_NAME_MAPPINGS File "C:\comf\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\searge_sdxl.py", line 32, in <module> from .modules.controlnet_adapter import SeargeControlnetAdapterV2 File "C:\comf\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\controlnet_adapter.py", line 31, in <module> from .controlnet import canny File "C:\comf\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\controlnet__init.py", line 4, in <module> from .canny import CannyDetector File "C:\comf\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\controlnet\canny__init__.py", line 2, in <module> import cv2 ModuleNotFoundError: No module named 'cv2' Cannot import C:\comf\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL module for custom nodes: No module named 'cv2'
Thanks dude... not sure if anyone asked this before, but is there a way for a batch img2img? For example: I have a folder with 1000 images and I want to do img2img on all of them (without loading manually each image)...
This is absolutely amazing! Great job - it's clear you put a lot of work and effort into this :D You are a blessing to this community!
Hi, I keep getting this error. Please help.
Error occurred when executing SeargeMagicBox: not enough values to unpack (expected 3, got 2) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\magic_box.py", line 269, in process (data, stage_result) = self.run_stage(stage, data, stage_input) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\magic_box.py", line 248, in run_stage (data, stage_result) = stage_processor.process(data, stage_input) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_latent_inputs.py", line 127, in process (width, height) = get_mask_size(mask) File "C:\Users\rkran\AI-StableDiffusion\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\utils.py", line 51, in get_mask_size (_, height, width) = mask.shape
I have the latest version '4.2.1'. Thanks!
This is great, thank you......
Everything works like charms,
Request to adopt also IP adapter option for other option of ReVision so we could have it integrated in this marvelous workflow.
I'm so done with this. Comfyui hasn't produced anything but garbage for a week and I'm past caring why, or why the rollbacks don't help, or any of it. I'm sick to death of this janky fucking garbage.
Error occurred when executing SeargeControlnetAdapterV2: stat: path should be string, bytes, os.PathLike or integer, not NoneType File "/media/comfydrive/comfyui3/ComfyUI/execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/media/comfydrive/comfyui3/ComfyUI/execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/media/comfydrive/comfyui3/ComfyUI/execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/media/comfydrive/comfyui3/ComfyUI/custom_nodes/SeargeSDXL/modules/controlnet_adapter.py", line 149, in get_value (stack_entry, image) = self.create_dict( File "/media/comfydrive/comfyui3/ComfyUI/custom_nodes/SeargeSDXL/modules/controlnet_adapter.py", line 110, in create_dict cn_image = self.process_image(cn_image, controlnet_mode, low_threshold, high_threshold) File "/media/comfydrive/comfyui3/ComfyUI/custom_nodes/SeargeSDXL/modules/controlnet_adapter.py", line 84, in process_image image = leres(image, low_threshold, high_threshold, self.leres_annotator_full_path) File "/media/comfydrive/comfyui3/ComfyUI/custom_nodes/SeargeSDXL/modules/controlnet/__init__.py", line 23, in leres annotator = LeresDetector.from_pretrained(annotator_model).to(model_management.get_torch_device()) File "/media/comfydrive/comfyui3/ComfyUI/custom_nodes/SeargeSDXL/modules/controlnet/leres/__init__.py", line 23, in from_pretrained if os.path.isdir(pretrained_model_or_path): File "/usr/lib/python3.10/genericpath.py", line 42, in isdir st = os.stat(s)
I'd like to request that the user be given the option to change the sampler when running the Hires fix if possible.
The reason for this is that in my testing, whilst DPM++ SDE tends to beat Euler out on image quality when it comes to generating images on the first pass, Euler blows everything else completely out of the water when it comes to the Hires pass, so being able to use DPM++ SDE on the first pass, and then switch to Euler for the second pass, seems like it would likely boost the quality of the final image drastically.
EDIT: By modifying the hires stage node to force the usage of Euler, I can confirm that generating the first step in DPM++ SDE and then using Euler in the hires step produces better results than either Euler or DPM++ SDE for both steps
Is anyone else getting this error?
When loading the graph, the following node types were not found:
• SeargePreviewImage
• SeargeTextInputV2
• SeargeMagicBox
• SeargeDebugPrinter
• SeargePipelineTerminator
• SeargeGenerationParameters
• SeargeImageSaving
• SeargeOperatingMode
• SeargeImage2ImageAndInpainting
• SeargeModelSelector
• SeargeConditionMixing
• SeargeCustomPromptMode
• SeargeCustomAfterVaeDecode
• SeargeSeparator
• SeargeConditioningParameters
• SeargeHighResolution
• SeargeAdvancedParameters
• SeargePromptStyles
• SeargeCustomAfterUpscaling
• SeargeUpscaleModels
• SeargeLoras
• SeargePipelineStart
• SeargeImageAdapterV2
• SeargePromptAdapterV2
• SeargeControlnetModels
• SeargeControlnetAdapterV2
• SeargeFreeU
Nodes that have failed to load will show as red on the graph.
It looks like the custom node extension is not installed properly
Great work, i just cant figure out how to enable Upscaling.
Hires is OK create image with preview. But Upscaling just dont and yes i have set final_upscale_size = 2, but still nothing.
Same problem, its probably a setting somewhere I can't find. Honestly this workflow is so big and custom I can't justify troubleshooting it until actual documentation.
Did you install all the required models with the install script or by following the manual install steps from the readme file? Upscaling only works if the upscale models are installed and selected.
I have every model that is in the readme, and still not showing anything on my upscale image preview
Yep me too. In the previous workflow there was a switch which was used to activate the upscaling.
I have this error message when generate an image :
"Error occurred when executing SeargeMagicBox: free_upper_bound + pytorch_used_bytes[device] <= device_total INTERNAL ASSERT FAILED at "..\\c10\\cuda\\CUDAMallocAsyncAllocator.cpp":540, please report a bug to PyTorch."
How can I solve this pleaaaase ? (I have all nodes and models installed)
I don't know what causes it, but from the error message it looks like your GPU may not be powerful enough. What GPU are you using and how much VRam do you have on it?
Is there a way to get clip skip to work with this workflow? Am I just missing it?
Also, like others I was facing some errors when trying to run the workflow. The Windows installer didn't install any of the required models listed in the readme, so I downloaded all of them included the recommended and everything worked fine after that.










