2024-08-28 22:20:36 +02:00
|
|
|
from core.stack import Stack
|
2024-08-28 10:39:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
class StableDiffusionForge(Stack):
|
|
|
|
def __init__(self):
|
|
|
|
super().__init__(
|
|
|
|
'StableDiffusion Forge WebUI',
|
2024-08-28 22:20:36 +02:00
|
|
|
'stable_diffusion_forge',
|
2024-08-28 10:39:27 +02:00
|
|
|
5003,
|
|
|
|
'https://github.com/lllyasviel/stable-diffusion-webui-forge'
|
|
|
|
)
|
|
|
|
|
2024-08-29 12:26:37 +02:00
|
|
|
def _install(self):
|
2024-08-28 10:39:27 +02:00
|
|
|
# Install the webui
|
|
|
|
self.git_clone(url=self.url, dest="webui")
|
|
|
|
|
|
|
|
self.python("launch.py --skip-torch-cuda-test --exit", current_dir="webui")
|
|
|
|
|
|
|
|
# Add NF4 support for Flux
|
|
|
|
self.install_from_prebuilt("bitsandbytes")
|
|
|
|
|
2024-08-29 12:26:37 +02:00
|
|
|
def _start(self):
|
2024-08-28 10:39:27 +02:00
|
|
|
args = ["--listen", "--enable-insecure-extension-access", "--port", str(self.port)]
|
2024-08-29 12:03:37 +02:00
|
|
|
self.python(f"launch.py", args=args, current_dir="webui",
|
2024-08-28 22:20:36 +02:00
|
|
|
env=["TORCH_BLAS_PREFER_HIPBLASLT=0"], daemon=True)
|