Vista Normal

Hay nuevos artículos disponibles. Pincha para refrescar la página.
AnteayerStableDiffusion

reForge WebUI updates, and: in need of a bit of help to support newer models, they are in the backend already!

15 Julio 2024 at 06:21

Hi there guys, hope is all going good!

First of all, let me start by thanking you all guys for the great vibes and such for this project, it really helps me a lot to motivate to do things!

So, when I was doing some edits in the code, I did notice that most of the backend (about 80%) of Forge is yep, ComfyUI. They share the same files, code and such.

So thanks to Comfyanonymous and lllyasviel, Forge was possible.

With reForge now, I have decided to take 2 ways.

First, related to branches and such. I said I will update to all the upstream changes (I can do) up to A1111, and I will keep doing it.

But since I noticed this mix of A1111-Comfy backend, I will update as well to upstream Comfy changes.

These branches will be:

  • main: Upstream A1111 changes.
  • dev_upstream: Upstream A1111 and Comfy changes.

What does this mean?

  • main branch will have the updates that come regularly to A1111, be dev or master. This will be mostly about:
    • First, UI changes, like related to javascript, html and gradio that comes into the A1111 WebUI.
    • Also samplers changes (like DDIM CFG++, PLMS CFG++, etc)
    • New schedulers
    • Denoiser settings
    • Some Optimizations.
    • All features itself that the WebUI implements, like skip Early CFG, refiner, etc as we know on the WebUI.
    • More!
  • dev_upstream will have the updates that come regularly to A1111, be dev or master and upstream changes (when applicable as A1111) from the Comfy backend. This mean:
    • Most of the optimizations.
    • New CLIPs.
    • New model_management, model_loader, VRAM features.
    • Support for new models.
    • New Samplers and Schedulers (when applicable).
    • New features that can be applied from args.
    • Fixes for LoRAs, DoRAs, Lycos, GLoRAs and more.
    • Support more extra networks.
    • More!

Okay, after all that, the main goal of the post.

-------------

Forge uses a file called forge_loader.py to actually load the models and start to doing inference, located at modules_forge folder. This file actually handles SD1.5, SD2.x and SDXL models.

I have (mostly) added code in the backend (that come from Comfy, so again, really thanks to him!), related for these next models:

  • CosXL
  • SD Cascade
  • SD3
  • Koala 700M/1B
  • SV3D
  • Stable Audio
  • AuraFlow

The code to make these models work are there, in reForge! But, since they aren't managed on forge_loader, they will actually fail to load by different errors.

So I wanted to ask, if possible, help to try to implement these models!

For the Audio or Video models, that can't be directly converted possibly, but for the rest, assuming you can load a single checkpoint it can work fairly directly. Special case is Cascade where you have to load various checkpoints at the same time, so a UI modification would be needed.

------

Also, besides that, I think the controlnet built it extension *could be* updated as how it manages Comfy backend, but that is something I have to check; for sure it won't be easy.

------

As for a TL:DR:

  • Branch main has A1111 upstream changes.
  • Branch dev_upstream has A1111 upstream and Comfy upstream changes.
  • Backend code for new models are on dev_upstream branch, but have to implement them on forge_loader.py to work.

So that's all guys. Time to sleep, I have been like 24 hours awake making commits and I think I'm bit tired.

Take care!

submitted by /u/panchovix
[link] [comments]

Since some people wanted, the fork I did from Forge with A1111 dev upstream updates, is now renamed to stable-diffusion-webui-reForge! Also with some other features!

12 Julio 2024 at 01:29
Since some people wanted, the fork I did from Forge with A1111 dev upstream updates, is now renamed to stable-diffusion-webui-reForge! Also with some other features!

Hi there guys, hope is all going good again!

Since the last post: https://www.reddit.com/r/StableDiffusion/comments/1dxbadd/ive_forked_forge_and_updated_the_most_i_could_to/, I've received a ton of good comments and such, so I'm really thankful for that!

So, it was discussed as well, a name that can differentiate a bit from forge itself, so I went ahead and renamed it to stable-diffusion-webui-reForge!

https://github.com/Panchovix/stable-diffusion-webui-reForge

My aim is to upstream the most I could do from A1111 dev into forge, and also, adding some features if possible.

Main branch is: dev_upstream_a1111

Main branch

"Beta" branch with maybe new features (for now, custom schedulers): dev_upstream_a1111_customschedulers

\"Beta\" branch

Take note, if you were using a previous version before the rebase (https://github.com/Panchovix/stable-diffusion-webui-reForge/commit/7f8f332ccafb600e9c7fefa39de44c6b90514626), I suggest to re-do the git clone process, since a bunch of changes were here.

Related to the past post, what some new/restored features and/or are fixed now.

  • Soft Inpainting
  • Multiple checkpoints loaded at the same time
  • DPM++ 2M CFG++
  • NMS (Negative Guidance minimum sigma all steps)
  • Skip Early CFG (Ignore negative prompt during early sampling)
  • NGMS all steps
  • Bit more performance to check for nans in unet only once, after all steps have been completed .
  • edit_model, skip_uncond, cond_scale
  • Fixed png_info for API
  • Fixed built-in controlnet not accepting ControlMode/Resizemode as int
  • Restored forge custom tree-view for loras, instead of the A1111 one
  • More Upscalers: COMPACT, GRL, OmniSR, SPAN, and SRFormer and fixes from https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14794

And more to come!

What still doesn't work/I couldn't/didn't know how to merge/fix (help needed!):

* SD3 (Since forge has it's own unet implementation, I didn't tinker on implementing it)

* Callback order ([https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/5bd27247658f2442bd4f08e5922afff7324a357a](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/5bd27247658f2442bd4f08e5922afff7324a357a)), specifically because the forge implementation of modules doesn't have script\_callbacks. So it broke the included controlnet extension and ui\_settings.py.

* Didn't tinker much about changes that affect extensions-builtin\\Lora, since forge does it mostly on ldm\_patched\\modules.

* precision-half (forge should have this by default)

* New "is\_sdxl" flag (sdxl works fine, but there are some new things that don't work without this flag)

* DDIM CFG++ (now WIP, getting black squares atm lol)

* Newer controlnet updates into the built-in extension.

Discussion here: https://github.com/Panchovix/stable-diffusion-webui-reForge/issues/1

For controlnet, I reallyyyyyyyyy want to update it to upstream controlnet extension, but I have tried some days but so far no luck. It is really, really hard to do this by myself, but I will try to see if I can implement some things in the built-in extension.

I have in mind to keep the updates and the forge speeds, so any help, is really really appreciated! And if you see any issue, please raise it on github so I or everyone can check it to fix it!

Updated: If you have a NVIDIA card I suggest to use --cuda-malloc --cuda-stream to get more performance.

Note that pin shared memory well, does that, even when changing models, so use it if you really need that boost (about 1-2%

Hope you guys enjoy!

Negative Guidance minimum sigma all steps (NGMS)

Skip Early CFG

submitted by /u/panchovix
[link] [comments]

I've forked Forge and updated (the most I could) to upstream dev A1111 changes!

7 Julio 2024 at 07:57
I've forked Forge and updated (the most I could) to upstream dev A1111 changes!

Hi there guys, hope is all going good.

I decided after forge not being updated after ~5 months, that it was missing a lot of important or small performance updates from A1111, that I should update it so it is more usable and more with the times if it's needed.

So I went, commit by commit from 5 months ago, up to today's updates of the dev branch of A1111 (https://github.com/AUTOMATIC1111/stable-diffusion-webui/commits/dev) and updated the code, manually, from the dev2 branch of forge (https://github.com/lllyasviel/stable-diffusion-webui-forge/commits/dev2) to see which could be merged or not, and which conflicts as well.

Here is the fork and branch (very important!): https://github.com/Panchovix/stable-diffusion-webui-forge/tree/dev_upstream_a1111

Make sure it is on dev_upstream_a111

All the updates are on the dev_upstream_a1111 branch and it should work correctly.

Some of the additions that it were missing:

  • Scheduler Selection
  • DoRA Support
  • Small Performance Optimizations (based on small tests on txt2img, it is a bit faster than Forge on a RTX 4090 and SDXL)
  • Refiner bugfixes
  • Negative Guidance minimum sigma all steps (to apply NGMS)
  • Optimized cache
  • Among lot of other things of the past 5 months.

If you want to test even more new things, I have added some custom schedulers as well (WIPs), you can find them on https://github.com/Panchovix/stable-diffusion-webui-forge/commits/dev_upstream_a1111_customschedulers/

  • CFG++
  • VP (Variance Preserving)
  • SD Turbo
  • AYS GITS
  • AYS 11 steps
  • AYS 32 steps

What doesn't work/I couldn't/didn't know how to merge/fix:

  • Soft Inpainting (I had to edit sd_samplers_cfg_denoiser.py to apply some A1111 changes, so I couldn't directly apply https://github.com/lllyasviel/stable-diffusion-webui-forge/pull/494)
  • SD3 (Since forge has it's own unet implementation, I didn't tinker on implementing it)
  • Callback order (https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/5bd27247658f2442bd4f08e5922afff7324a357a), specifically because the forge implementation of modules doesn't have script_callbacks. So it broke the included controlnet extension and ui_settings.py.
  • Didn't tinker much about changes that affect extensions-builtin\Lora, since forge does it mostly on ldm_patched\modules.
  • precision-half (forge should have this by default)
  • New "is_sdxl" flag (sdxl works fine, but there are some new things that don't work without this flag)
  • DDIM CFG++ (because the edit on sd_samplers_cfg_denoiser.py)
  • Probably others things

The list (but not all) I couldn't/didn't know how to merge/fix is here: https://pastebin.com/sMCfqBua.

I have in mind to keep the updates and the forge speeds, so any help, is really really appreciated! And if you see any issue, please raise it on github so I or everyone can check it to fix it!

If you have a NVIDIA card, I suggest to use --cuda-malloc --cuda-stream --pin-shared-memory to get more performance.

After ~20 hours of coding for this, finally sleep...

Happy genning!

submitted by /u/panchovix
[link] [comments]
❌
❌