[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71932":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":8,"language":10,"languages":8,"totalLinesOfCode":8,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":8,"rankLanguage":8,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":8,"pushedAt":8,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},71932,"stable-diffusion-webui-forge","lllyasviel\u002Fstable-diffusion-webui-forge","lllyasviel",null,"","Python",12709,1612,118,1120,0,18,55,164,54,116.62,"GNU Affero General Public License v3.0",false,"main",[],"2026-06-12 04:01:02","# Stable Diffusion WebUI Forge\n\nStable Diffusion WebUI Forge is a platform on top of [Stable Diffusion WebUI](https:\u002F\u002Fgithub.com\u002FAUTOMATIC1111\u002Fstable-diffusion-webui) (based on [Gradio](https:\u002F\u002Fwww.gradio.app\u002F) \u003Ca href='https:\u002F\u002Fgithub.com\u002Fgradio-app\u002Fgradio'>\u003Cimg src='https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fgradio-app\u002Fgradio'>\u003C\u002Fa>) to make development easier, optimize resource management, speed up inference, and study experimental features.\n\nThe name \"Forge\" is inspired from \"Minecraft Forge\". This project is aimed at becoming SD WebUI's Forge.\n\nForge is currently based on SD-WebUI 1.10.1 at [this commit](https:\u002F\u002Fgithub.com\u002FAUTOMATIC1111\u002Fstable-diffusion-webui\u002Fcommit\u002F82a973c04367123ae98bd9abdf80d9eda9b910e2). (Because original SD-WebUI is almost static now, Forge will sync with original WebUI every 90 days, or when important fixes.)\n\nNews are moved to this link: [Click here to see the News section](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fblob\u002Fmain\u002FNEWS.md)\n\n# Quick List\n\n[Gradio 4 UI Must Read (TLDR: You need to use RIGHT MOUSE BUTTON to move canvas!)](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F853)\n\n[Flux Tutorial (BitsandBytes Models, NF4, \"GPU Weight\", \"Offload Location\", \"Offload Method\", etc)](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F981)\n\n[Flux Tutorial 2 (Seperated Full Models, GGUF, Technically Correct Comparison between GGUF and NF4, etc)](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1050)\n\n[Forge Extension List and Extension Replacement List (Temporary)](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1754)\n\n[How to make LoRAs more precise on low-bit models; How to Skip\" Patching LoRAs\"; How to only load LoRA one time rather than each generation; How to report LoRAs that do not work](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1038)\n\n[Report Flux Performance Problems (TLDR: DO NOT set \"GPU Weight\" too high! Lower \"GPU Weight\" solves 99% problems!)](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1181)\n\n[How to solve \"Connection errored out\" \u002F \"Press anykey to continue ...\" \u002F etc](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1474)\n\n[(Save Flux BitsandBytes UNet\u002FCheckpoint)](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1224#discussioncomment-10384104)\n\n[LayerDiffuse Transparent Image Editing](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F854)\n\n[Tell us what is missing in ControlNet Integrated](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F932)\n\n[(Policy) Soft Advertisement Removal Policy](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F1286)\n\n(Flux BNB NF4 \u002F GGUF Q8_0\u002FQ5_0\u002FQ5_1\u002FQ4_0\u002FQ4_1 are all natively supported with GPU weight slider and Quene\u002FAsync Swap toggle and swap location toggle. All Flux BNB NF4 \u002F GGUF Q8_0\u002FQ5_0\u002FQ4_0 have LoRA support.)\n\n# Installing Forge\n\n**Just use this one-click installation package (with git and python included).**\n\n[>>> Click Here to Download One-Click Package (CUDA 12.1 + Pytorch 2.3.1) \u003C\u003C\u003C](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Freleases\u002Fdownload\u002Flatest\u002Fwebui_forge_cu121_torch231.7z)\n\nSome other CUDA\u002FTorch Versions:\n\n[Forge with CUDA 12.1 + Pytorch 2.3.1](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Freleases\u002Fdownload\u002Flatest\u002Fwebui_forge_cu121_torch231.7z) \u003C- **Recommended**\n\n[Forge with CUDA 12.4 + Pytorch 2.4](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Freleases\u002Fdownload\u002Flatest\u002Fwebui_forge_cu124_torch24.7z) \u003C- **Fastest**, but MSVC may be broken, xformers may not work\n\n[Forge with CUDA 12.1 + Pytorch 2.1](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Freleases\u002Fdownload\u002Flatest\u002Fwebui_forge_cu121_torch21.7z) \u003C- the previously used old environments\n\nAfter you download, you uncompress, use `update.bat` to update, and use `run.bat` to run.\n\nNote that running `update.bat` is important, otherwise you may be using a previous version with potential bugs unfixed.\n\n![image](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fassets\u002F19834515\u002Fc49bd60d-82bd-4086-9859-88d472582b94)\n\n### Advanced Install\n\nIf you are proficient in Git and you want to install Forge as another branch of SD-WebUI, please see [here](https:\u002F\u002Fgithub.com\u002Fcontinue-revolution\u002Fsd-webui-animatediff\u002Fblob\u002Fforge\u002Fmaster\u002Fdocs\u002Fhow-to-use.md#you-have-a1111-and-you-know-git). In this way, you can reuse all SD checkpoints and all extensions you installed previously in your OG SD-WebUI, but you should know what you are doing.\n\nIf you know what you are doing, you can also install Forge using same method as SD-WebUI. (Install Git, Python, Git Clone the forge repo `https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge.git` and then run webui-user.bat).\n\n### Previous Versions\n\nYou can download previous versions [here](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fdiscussions\u002F849).\n\n# Forge Status\n\nBased on manual test one-by-one:\n\n| Component                                           | Status                                      | Last Test    |\n|-----------------------------------------------------|---------------------------------------------|--------------|\n| Basic Diffusion                                     | Normal                                      | 2024 Aug 26  |\n| GPU Memory Management System                        | Normal                                      | 2024 Aug 26  |\n| LoRAs                                               | Normal                                      | 2024 Aug 26  |\n| All Preprocessors                                   | Normal                                      | 2024 Aug 26  |\n| All ControlNets                                     | Normal                                      | 2024 Aug 26  |\n| All IP-Adapters                                     | Normal                                      | 2024 Aug 26  |\n| All Instant-IDs                                     | Normal                                      | 2024 July 27 |\n| All Reference-only Methods                          | Normal                                      | 2024 July 27 |\n| All Integrated Extensions                           | Normal                                      | 2024 July 27 |\n| Popular Extensions (Adetailer, etc)                 | Normal                                      | 2024 July 27 |\n| Gradio 4 UIs                                        | Normal                                      | 2024 July 27 |\n| Gradio 4 Forge Canvas                               | Normal                                      | 2024 Aug 26  |\n| LoRA\u002FCheckpoint Selection UI for Gradio 4           | Normal                                      | 2024 July 27 |\n| Photopea\u002FOpenposeEditor\u002Fetc for ControlNet          | Normal                                      | 2024 July 27 |\n| Wacom 128 level touch pressure support for Canvas   | Normal                                      | 2024 July 15 |\n| Microsoft Surface touch pressure support for Canvas | Broken, pending fix                         | 2024 July 29 |\n| ControlNets (Union)                                 | Not implemented yet, pending implementation | 2024 Aug 26  |\n| ControlNets (Flux)                                  | Not implemented yet, pending implementation | 2024 Aug 26  |\n| API endpoints (txt2img, img2img, etc)               | Normal, but pending improved Flux support   | 2024 Aug 29  |\n| OFT LoRAs                                           | Broken, pending fix                         | 2024 Sep 9   |\n\nFeel free to open issue if anything is broken and I will take a look every several days. If I do not update this \"Forge Status\" then it means I cannot reproduce any problem. In that case, fresh re-install should help most.\n\n# UnetPatcher\n\nBelow are self-supported **single file** of all codes to implement FreeU V2.\n\nSee also `extension-builtin\u002Fsd_forge_freeu\u002Fscripts\u002Fforge_freeu.py`:\n\n```python\nimport torch\nimport gradio as gr\n\nfrom modules import scripts\n\n\ndef Fourier_filter(x, threshold, scale):\n    # FFT\n    x_freq = torch.fft.fftn(x.float(), dim=(-2, -1))\n    x_freq = torch.fft.fftshift(x_freq, dim=(-2, -1))\n\n    B, C, H, W = x_freq.shape\n    mask = torch.ones((B, C, H, W), device=x.device)\n\n    crow, ccol = H \u002F\u002F 2, W \u002F\u002F 2\n    mask[..., crow - threshold:crow + threshold, ccol - threshold:ccol + threshold] = scale\n    x_freq = x_freq * mask\n\n    # IFFT\n    x_freq = torch.fft.ifftshift(x_freq, dim=(-2, -1))\n    x_filtered = torch.fft.ifftn(x_freq, dim=(-2, -1)).real\n\n    return x_filtered.to(x.dtype)\n\n\ndef patch_freeu_v2(unet_patcher, b1, b2, s1, s2):\n    model_channels = unet_patcher.model.diffusion_model.config[\"model_channels\"]\n    scale_dict = {model_channels * 4: (b1, s1), model_channels * 2: (b2, s2)}\n    on_cpu_devices = {}\n\n    def output_block_patch(h, hsp, transformer_options):\n        scale = scale_dict.get(h.shape[1], None)\n        if scale is not None:\n            hidden_mean = h.mean(1).unsqueeze(1)\n            B = hidden_mean.shape[0]\n            hidden_max, _ = torch.max(hidden_mean.view(B, -1), dim=-1, keepdim=True)\n            hidden_min, _ = torch.min(hidden_mean.view(B, -1), dim=-1, keepdim=True)\n            hidden_mean = (hidden_mean - hidden_min.unsqueeze(2).unsqueeze(3)) \u002F (hidden_max - hidden_min).unsqueeze(2).unsqueeze(3)\n\n            h[:, :h.shape[1] \u002F\u002F 2] = h[:, :h.shape[1] \u002F\u002F 2] * ((scale[0] - 1) * hidden_mean + 1)\n\n            if hsp.device not in on_cpu_devices:\n                try:\n                    hsp = Fourier_filter(hsp, threshold=1, scale=scale[1])\n                except:\n                    print(\"Device\", hsp.device, \"does not support the torch.fft.\")\n                    on_cpu_devices[hsp.device] = True\n                    hsp = Fourier_filter(hsp.cpu(), threshold=1, scale=scale[1]).to(hsp.device)\n            else:\n                hsp = Fourier_filter(hsp.cpu(), threshold=1, scale=scale[1]).to(hsp.device)\n\n        return h, hsp\n\n    m = unet_patcher.clone()\n    m.set_model_output_block_patch(output_block_patch)\n    return m\n\n\nclass FreeUForForge(scripts.Script):\n    sorting_priority = 12  # It will be the 12th item on UI.\n\n    def title(self):\n        return \"FreeU Integrated\"\n\n    def show(self, is_img2img):\n        # make this extension visible in both txt2img and img2img tab.\n        return scripts.AlwaysVisible\n\n    def ui(self, *args, **kwargs):\n        with gr.Accordion(open=False, label=self.title()):\n            freeu_enabled = gr.Checkbox(label='Enabled', value=False)\n            freeu_b1 = gr.Slider(label='B1', minimum=0, maximum=2, step=0.01, value=1.01)\n            freeu_b2 = gr.Slider(label='B2', minimum=0, maximum=2, step=0.01, value=1.02)\n            freeu_s1 = gr.Slider(label='S1', minimum=0, maximum=4, step=0.01, value=0.99)\n            freeu_s2 = gr.Slider(label='S2', minimum=0, maximum=4, step=0.01, value=0.95)\n\n        return freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2\n\n    def process_before_every_sampling(self, p, *script_args, **kwargs):\n        # This will be called before every sampling.\n        # If you use highres fix, this will be called twice.\n\n        freeu_enabled, freeu_b1, freeu_b2, freeu_s1, freeu_s2 = script_args\n\n        if not freeu_enabled:\n            return\n\n        unet = p.sd_model.forge_objects.unet\n\n        unet = patch_freeu_v2(unet, freeu_b1, freeu_b2, freeu_s1, freeu_s2)\n\n        p.sd_model.forge_objects.unet = unet\n\n        # Below codes will add some logs to the texts below the image outputs on UI.\n        # The extra_generation_params does not influence results.\n        p.extra_generation_params.update(dict(\n            freeu_enabled=freeu_enabled,\n            freeu_b1=freeu_b1,\n            freeu_b2=freeu_b2,\n            freeu_s1=freeu_s1,\n            freeu_s2=freeu_s2,\n        ))\n\n        return\n```\n\nSee also [Forge's Unet Implementation](https:\u002F\u002Fgithub.com\u002Flllyasviel\u002Fstable-diffusion-webui-forge\u002Fblob\u002Fmain\u002Fbackend\u002Fnn\u002Funet.py).\n\n# Under Construction\n\nWebUI Forge is now under some constructions, and docs \u002F UI \u002F functionality may change with updates.\n","Stable Diffusion WebUI Forge 是一个基于 Stable Diffusion WebUI 的开发平台，旨在简化开发流程、优化资源管理、加速推理过程并探索实验性功能。该项目采用Python编写，并基于Gradio框架构建用户界面，支持多种模型格式如Flux BNB NF4和GGUF Q8_0\u002FQ5_0等的本地化运行与LoRA兼容，通过GPU权重滑块、异步交换等功能实现更高效的计算资源利用。适用于需要快速迭代AI生成图像算法的研究人员及开发者，特别是在对模型性能有高要求且追求便捷操作体验的应用场景中表现出色。",2,"2026-06-11 03:39:31","high_star"]