CivArchive
    Searge-SDXL: EVOLVED v4.3.2 - Optimized Workflow for ComfyUI - 2023-11-13 - txt2img, img2img, inpaint, revision, controlnet, loras, FreeU v1 & v2, ... - v4.1
    Preview 2367726
    Preview 2367720
    Preview 2367718
    Preview 2367723
    Preview 2367721
    Preview 2367724
    Preview 2367725
    Preview 2367728
    Preview 2367729
    Preview 2367727

    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 .json file in the workflow folder

    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 examples folder 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 quality

    • Improved 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

    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 examples folder have been updated to embed the v4.1 workflow

    FAQ

    Comments (60)

    ryanmisagonzalesSep 6, 2023
    CivitAI

    Can't get inpainting to work on v4.1, Searge. I did as instructed, loaded the image in the source image and masking boxes. Did a mask, and it outputs the same image. How can I get it to work?

    searge
    Author
    Sep 6, 2023· 1 reaction

    I assume you already switched the operating mode of the workflow to inpainting, but did you also try different values for the denoise setting (first setting in the Img2Img & Inpaint UI box)?

    ryanmisagonzalesSep 6, 2023

    Yes I made sure to switch the operating mode to inpainting before queuing. Okay I'll try to play with different denoise settings again. Will get back to you with the result.

    gemyerstSep 6, 2023
    CivitAI

    Hi Searge! Awesome workflow, I wanted to ask how to get the best results with controlnet turned on (I am using the intermediate script)? The outputs are great with it off, however once its turned on, the higher the strength the less realistic the image (but the more it resembles the canny of the input). Do you have recommended settings for using controlnet?

    searge
    Author
    Sep 6, 2023

    I usually reduce the strength of controlnet to something between 0.5-0.8 and it's also worth trying values for end_percent in the 0.4-0.9 range

    halarioushandleSep 6, 2023
    CivitAI

    Ran the installer script, but having the following error: Error occurred when executing SeargeMagicBox: get_additional_models() takes 2 positional arguments but 3 were given

    searge
    Author
    Sep 6, 2023· 1 reaction

    You need to update ComfyUI to the latest version

    halarioushandleSep 7, 2023

    @searge Yeah I'm dumb lol! Thanks, that worked

    SECoursesSep 7, 2023· 2 reactions
    CivitAI

    Nice workflow

    searge
    Author
    Sep 8, 2023

    You realize that this is a Comfy workflow and not a model, right? Not sure why you would advertise a video here that doesn't even cover ComfyUI workflows.

    SECoursesSep 8, 2023

    @searge I thought i had filtered models my mistake. updated my comment. hopefully i will make a tutorial for comfyui too. i may show your workflow there

    BooyaihSep 9, 2023
    CivitAI

    When I add another type of custom node to Comfyai for example - reactor node I can no longer use this one as every node goes red saying it's not installed. I have to delete the reactor folder from the custom node folder for it to work again. Is there any way around this?

    searge
    Author
    Sep 9, 2023· 1 reaction

    Could you report it as an issue on the Github bug tracker? This shouldn't happen, so let's figure out what's going wrong.

    BooyaihSep 10, 2023

    @searge Pretty new to all this whats the best way to do that?

    byttledSep 11, 2023
    CivitAI

    how should i use this with a "stability matrix" ComfyUI install? not sure if portable or whatever.

    searge
    Author
    Sep 11, 2023

    Unfortunately I have no experience with Stability Matrix. But as long as it installs the portable version of ComfyUI it should work.

    TheGreatOne321Sep 11, 2023
    CivitAI

    Am I the only one who's VRAM gets maxed out with the latest v4 workflows? On v3 of the workflow I could easily do 1024x1024 with 2x hires in around 65 seconds using around 14-16 gigs of VRAM.

    With the latest workflows, it takes me at minimum 120 seconds to do a 1024x1024 with 1.25x hires, and doing so results in my 24 gigs of VRAM being maxed out and overflowing into shared memory.

    The images are undoubtedly higher quality, but I don't know if it's higher enough to justify waiting twice as long.

    searge
    Author
    Sep 11, 2023· 1 reaction

    There were some recent changes to ComfyUI to utilize more VRam if available. If I remember correctly a new command line parameter was added to ComfyUI if you prefer the old behavior. I'm using that parameter and v4.x of the workflow is using the same amount of VRam as I saw with older v3.x versions.

    searge
    Author
    Sep 11, 2023· 1 reaction

    To clarify, take a look at the parameter --disable-smart-memory for ComfyUI

    TheGreatOne321Sep 11, 2023

    @searge Thanks a ton! Wasn't aware that the change was in ComfyUI itself. This fixed everything

    hio_kosoSep 11, 2023
    CivitAI

    The workflow is really fast and amazing with SDXL checkpoint. But whenever I attempt to run an SD checkpoint, I receive an error message, whether I have made a mistake or i am simply dumb (I am dumb). Tried to reinstall the XDSL UI but still the same. I don't have the portable comfy, so I copied with git and downloaded/copied the recommend and required file in the right folder, run the python -m pip install opencv-python command but always the same error.

    https://i.ibb.co/rdS4c15/Capture-d-cran-2023-09-11-121750.png

    searge
    Author
    Sep 11, 2023

    This workflow is explicitly designed for SDXL based models. Older SD 1.5 or SD 2.x models won't currently work, but I'm considering to add support for them in a future update.

    hio_kosoSep 11, 2023

    @searge 

    Thank's, so I'm really dumb and the ui works just fine xD.

    Easy and pretty clear ui to use even for a neophyte like me. Great if the SD can be implemented even if is pretty simple to switch ui with comfy.

    iseedeadpeople88Sep 12, 2023· 1 reaction
    CivitAI

    Are inpainting and img2img working properly? No matter what combination of settings I try on 4.1 starting from the default settings in the workflow JSON, I just get a version of the original sketch back out where the inpainted area appears to be inferred from the image, not conditioned on the prompt.


    To reproduce:
    • Pull Searge and Comfy repos to make sure they're up to date
    • Open Searge-SDXL-Reborn-v4_1-hq.json
    • Change Operating Mode to 'in-painting' or 'image-to-image'
    • Open Inpainting Mask in Mask Editor and remove some portion of the image
    • Confirm all model settings point to corresponding files on disk
    • Change image size preset to 1:1 (1024x1024)
    • Queue Prompt

    Expected result:
    I'd expect the inpainted area to be an image of the scene described in the prompt(s)

    Result:

    The inpainted area is a continuation of the source image and ignores the prompts. For example - mask out the girl's face in the default sketch and it will draw her face back in with some deviation from the original.

    iseedeadpeople88Sep 12, 2023

    I should specify that there are no errors in the terminal when running this.

    searge
    Author
    Sep 12, 2023

    Did you increase the denoise value in the img2img & inpainting settings?

    iseedeadpeople88Sep 12, 2023

    @searge that not only works, it makes sense! ;) Thanks for getting back to me. 2 followup Qs:
    1) Is there a recommended denoise value there? I'm not sure what's going on under the hood.
    2) Any plans to incorporate the official SDXL inpainting model?

    Thanks again

    RandalphiusSep 14, 2023
    CivitAI

    Thanks, great workflow! I'm still overwhelmed with all the possibilities, nevertheless looking forward to new updates and implementations.

    searge
    Author
    Sep 14, 2023

    Thank you. Glad to hear that you enjoy the workflow.

    1083292Sep 15, 2023
    CivitAI

    Hi,

    would it be possible to get an optional workflow with the PerpNeg sampler integrated? The tradeoff here is nearly double generation times for better prompt adherence

    https://github.com/bvhari/ComfyUI_PerpNeg

    searge
    Author
    Oct 4, 2023

    I'll look into it for potential addition to a future update

    DarkCoverSep 15, 2023
    CivitAI

    Hello sir, Really loved your workflow. I had like to request. I don't have a huge vram so I usually upscale my photos using Ultimate SD tile upscale and I use SD 1.5 models. If I was to incorporate that kind of workflow into your workflow for upscaling. How can I achieve it? And I am really sorry if this is not right of me to ask to make modifications to your workflow.

    searge
    Author
    Oct 4, 2023

    This workflow is explicitly made for SDXL and doesn't work with SD 1.5 models

    bulletti515Sep 16, 2023
    CivitAI

    How exactly does the latent detailer process work? I have zero programming experience, so I have only deduced that it upscales the sampled latent by 2x, runs 5 steps, rescales to original, and runs another 10 steps.

    I can't decipher the part of the code that sets the step counts:
    start_step=int(100 - percent * 2), last_step=int(100 - percent)

    I'm trying to deseargify your workflow to better understand SD, your WF, and relevant systems.

    ryanmisagonzalesSep 16, 2023
    CivitAI

    Hi Searge. Where or how should I find or enter this code? --disable-smart-memory

    searge
    Author
    Oct 4, 2023

    It's a command line parameter to pass in the start script for ComfyUI

    AnubajaSep 19, 2023· 2 reactions
    CivitAI

    Hi Searge,

    Love the work you have done.... I can achieve wayyy better images using this workflow. the fact i can create my own "workspaces" by moving everything around to suit myself to what ever im doing is great.... so great. I save my basic img gen workspace in a png and then if i want controlnet i get my controlnet png and drag that in.... amazing work!!!! Comfy was a little overwhelming coming from A1111 and i was at a loss as to how to setup all the different things to work correctly (controlnet for example).

    The only thing i miss is a "testing station". Adding a X/Y plot area would be amazing (somehow having a X/Y/Z would be even better ;) )

    Keep up the good work man. This must be quite the project for you, especially with everything always changing. Most of us are benefiting for free. I dont know your situation but please dont worry about any pressure from the community (like above), try not to burnout doing this work.

    searge
    Author
    Oct 4, 2023

    I'm planning to look into the X/Y plot for potential addition to a future update

    cloudreadypcSep 21, 2023
    CivitAI

    Sorry to inform you that mine crashes in sampling stage.

    custom_sdxl_ksampler.py, line 202

    if refiner_detail_boost > 0.0

    TypeError: '>' not supported between instances of 'NoneType' and 'float'

    I've all models in place. Thanks a lot.

    searge
    Author
    Oct 4, 2023

    Could you report it on the bug tracker on Github if it's still an issue?

    JohanllzSep 23, 2023· 2 reactions
    CivitAI

    Can anybody help? the past version worked fine (3.x), but the new 4.1 is not working and i'm getting an error, I updated searge with the new script. The error says:

    "Error occurred when executing SeargeMagicBox: Error while deserializing header: MetadataIncompleteBuffer File ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "F:\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\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 ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\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 "F:\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\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 ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\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 ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_load_checkpoints.py", line 211, in process clip_vision_model = NodeWrapper.clipvision_loader.load_clip(clipvision_name)[0] File ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\nodes.py", line 757, in load_clip clip_vision = comfy.clip_vision.load(clip_path) File ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\comfy\clip_vision.py", line 110, in load sd = load_torch_file(ckpt_path) File ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\ComfyUI\comfy\utils.py", line 13, in load_torch_file sd = safetensors.torch.load_file(ckpt, device=device.type) File ":\xxxxx\ComfyUI_windows_portable_nvidia_cu118_or_cpu\ComfyUI_windows_portable\python_embeded\lib\site-packages\safetensors\torch.py", line 309, in load_file with safe_open(filename, framework="pt", device=device) as f:"

    searge
    Author
    Oct 4, 2023

    It looks like it's missing some of the required models

    drangelosSep 23, 2023
    CivitAI

    This is a great workflow. Thank you for creating it. One question: is there a way to do live previews of the steps of the image generation in ComfyUI (meaning to see what it looks like in step 12, 15, etc.)? I suspect that in some cases the earlier steps look better- and it'd help in assessing whether to limit the steps in which the controlnets are applied. Right now it is a bit of blind guessing.

    searge
    Author
    Oct 4, 2023

    Not sure if ComfyUI supports this

    TeralaSep 27, 2023
    CivitAI

    first: while 4.0 works great without any issues at all, 4.1 always stuck's at highres detailer stage, takes ages and then -literally- crushes my mashine ;)

    second: sdxl has two different types to prompt ... i think clip l and clip g or something was it,

    but ... what exactly is "main prompt" and "secondary prompt" in this workflow refering to?

    searge
    Author
    Oct 4, 2023

    The main prompt is for CLIP G and secondary prompt is for CLIP L

    arteangelusSep 28, 2023· 2 reactions
    CivitAI

    I installed it twice from zero but I still get this error;

    Error occurred when executing SeargeMagicBox: Error while deserializing header: MetadataIncompleteBuffer File "C:\Users\...\Desktop\COMFY\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\Users\...\Desktop\COMFY\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\...\Desktop\COMFY\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "C:\Users\...\Desktop\COMFY\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\...\Desktop\COMFY\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\...\Desktop\COMFY\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_load_checkpoints.py", line 95, in process refiner_checkpoint = NodeWrapper.checkpoint_loader.load_checkpoint(refiner_name) File "C:\Users\...\Desktop\COMFY\ComfyUI\nodes.py", line 476, in load_checkpoint out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings")) File "C:\Users\...\Desktop\COMFY\ComfyUI\comfy\sd.py", line 396, in load_checkpoint_guess_config sd = comfy.utils.load_torch_file(ckpt_path) File "C:\Users\...\Desktop\COMFY\ComfyUI\comfy\utils.py", line 13, in load_torch_file sd = safetensors.torch.load_file(ckpt, device=device.type) File "C:\Users\...\Desktop\COMFY\python_embeded\lib\site-packages\safetensors\torch.py", line 309, in load_file with safe_open(filename, framework="pt", device=device) as f:

    Help please

    san15981Sep 29, 2023
    I also received this error message
    searge
    Author
    Oct 4, 2023

    You seem to be missing some of the required models

    LDWorksDavidSep 29, 2023
    CivitAI

    Im a bit late joining the ComfyUI's side but wanted to ask something. Is there any workflow that allows me:
    - Generate a SDXL output AND automatically use this output via Img2img in a custom SD 1.5 I want, with a custom upscaler and custom VAE? All I see is generate SDXL output and change mode to img2img and load the image but I'd want to do that automatically for running batches with a custom SD 1.5 model in the img2img and a sharper VAE for that. IS this possible?

    AyertoscoOct 1, 2023

    Don't know if it's what you're asking, but from VAEDecode, you can go out to a VAEencode node that can be used as a latent for another process

    searge
    Author
    Oct 4, 2023

    Right now the workflow supports SDXL but not SD 1.5 but following the description in the previous comment you should be able to extend it for your needs

    dongmeiteng2008878Oct 2, 2023
    CivitAI

    I am running on Linux, the installation has failed many times, the node has not been loaded out, please ask the author has any solution, thank you very much

    searge
    Author
    Oct 4, 2023

    Without more details on the problems you are encountering I can't help much. Could you report it on the bug tracker on Github?

    modzhahead158Oct 3, 2023
    CivitAI

    when I try to do an inpaint, the error below occurs, regardless of the workflow settings:

    Error occurred when executing SeargeMagicBox: too many values to unpack (expected 2)

    File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\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:\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:\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:\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:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_latent_inputs.py", line 127, in process (width, height) = get_mask_size(mask) File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\utils.py", line 51, in get_mask_size (height, width) = mask.shape

    ChrisdonOct 4, 2023· 1 reaction

    same here

    searge
    Author
    Oct 4, 2023· 2 reactions

    This has been fixed in v4.2

    modzhahead158Oct 4, 2023

    @searge thanks very much, now it's works fine!

    modzhahead158Oct 5, 2023

    @searge I'm sorry, but there is a new bug with inpaint, workflow was updated to 4.2.1, in the stage of Latent Inputs:

    Error occurred when executing SeargeMagicBox: 'NoneType' object has no attribute 'reshape' File "C:\ComfyUI_windows_portable\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "C:\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:\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:\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:\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:\ComfyUI_windows_portable\ComfyUI\custom_nodes\SeargeSDXL\modules\stage_latent_inputs.py", line 132, in process mask_image = NodeWrapper.mask_to_image.mask_to_image(mask)[0] File "C:\ComfyUI_windows_portable\ComfyUI\custom_nodes\AIT\AITemplate\..\..\..\comfy_extras\nodes_mask.py", line 108, in mask_to_image result = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3)

    ChrisdonOct 14, 2023

    @searge you are the man Searge

    Workflows
    SDXL 1.0

    Details

    Downloads
    2,823
    Platform
    CivitAI
    Platform Status
    Available
    Created
    9/5/2023
    Updated
    8/11/2026
    Deleted
    -

    Files

    seargeSDXLEVOLVEDV432OptimizedWorkflowForComfyui_v41.zip