{"id":19417799,"url":"https://github.com/bradsec/sdnotes","last_synced_at":"2025-02-25T03:41:20.424Z","repository":{"id":182200103,"uuid":"668102330","full_name":"bradsec/sdnotes","owner":"bradsec","description":"Stable Diffusion notes and guides for running in a Linux environment","archived":false,"fork":false,"pushed_at":"2023-07-19T03:43:39.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T17:24:42.304Z","etag":null,"topics":["automatic1111","comfyui","debian","linux","stable-diffusion","stable-diffusion-webui"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradsec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-19T03:17:11.000Z","updated_at":"2023-12-14T18:06:50.000Z","dependencies_parsed_at":"2023-07-19T04:43:06.803Z","dependency_job_id":null,"html_url":"https://github.com/bradsec/sdnotes","commit_stats":null,"previous_names":["bradsec/sdnotes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fsdnotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fsdnotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fsdnotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradsec%2Fsdnotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradsec","download_url":"https://codeload.github.com/bradsec/sdnotes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240599184,"owners_count":19826959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automatic1111","comfyui","debian","linux","stable-diffusion","stable-diffusion-webui"],"created_at":"2024-11-10T13:11:26.273Z","updated_at":"2025-02-25T03:41:20.401Z","avatar_url":"https://github.com/bradsec.png","language":null,"readme":"# Stable Diffusion Notes\n\n***These instructions contain Linux shell scripts, (not suitable for Windows)***\n\n## Running Automatic1111 and ComfyUI together sharing Python environment and models\n\n### How to use Automatic1111 Python virtual environment (venv) and requirements with ComfyUI.\n\nCreate a shell script in the ComfyUI root directory to activate Automatic1111 venv\n\nExample of `/ComfyUI/start.sh` script\n```terminal\n#!/bin/sh\n\n# Modify paths as required.\nPYTHON_ENV=/home/username/stable-diffusion-webui/venv/bin\nCOMFYUI_PATH=/home/username/ComfyUI\n\ncd $COMFYUI_PATH\n# Update ComfyUI to latest source release\ngit pull\n\n# Activate venv#!/bin/sh\n\nPYTHON_ENV=/home/username/stable-diffusion-webui/venv/bin\nCOMFYUI_PATH=/home/username/ComfyUI\n\ncd $COMFYUI_PATH\ngit pull\n\n. $PYTHON_ENV/activate\npython3 $COMFYUI_PATH/main.py --listen\n\n. $PYTHON_ENV/activate\n\n# Lauch comfyui --listen makes network accessable\npython3 $COMFYUI_PATH/main.py --listen\n```\n\n### How to use existing Automatic1111 models in ComfyUI\n\nEdit `extra_model_paths.yaml` located in the ComfyUI root folder.\n\nExample of extra_model_paths.yaml contents:\n```terminal\na111:\n    base_path: /home/username/stable-diffusion-webui/\n\n    checkpoints: models/Stable-diffusion\n    configs: models/Stable-diffusion\n    vae: models/VAE\n    loras: |\n         models/Lora\n         models/LyCORIS\n    upscale_models: |\n                  models/ESRGAN\n                  models/RealESRGAN\n                  models/SwinIR\n    embeddings: embeddings\n    hypernetworks: models/hypernetworks\n    controlnet: models/ControlNet\n```\n\n### How to run Automatic1111 and ComfyUI as a linux systemd service\n\nBelow is a shell script to create services for both Automatic1111 and ComfyUI.\n\n**Make sure to make changes to `username` and also paths to application locations in the Service One and Service Two section**\n\n\n\n```terminal\n#!/bin/sh\n\n############################################\n# Debian Linux configure as service script #\n############################################\n\n\n# Function for creating new systemd service\nwrite_service_config() {\n\t# Check if the service already exists\n\techo \"Checking for existing ${service_name} service...\"\n    if systemctl --quiet is-enabled ${service_name} 2\u003e/dev/null\n    then\n        echo \"Service ${service_name} already exists. Skipping...\"\n        return\n    fi\n    echo \"Creating service for ${service_name}...\"\n\tsudo touch \"/var/log/${service_name}.log\"\n\tsudo tee \"/etc/systemd/system/${service_name}.service\" 1\u003e/dev/null \u003c\u003cEOF\n[Unit]\nDescription=${service_desc}\nAfter=network.target\n\n[Service]\nUser=${service_user}\nGroup=${service_group}\nWorkingDirectory=${working_dir}\nExecStart=${exec_start}\nRestart=always\nRestartSec=3\nStandardOutput=file:/var/log/${service_name}.log\nStandardError=file:/var/log/${service_name}.log\n\n[Install]\nWantedBy=multi-user.target\nEOF\n\n\techo \"Enabling ${service_name} service and reloading service daemon...\"\n\tsudo systemctl enable ${service_name}\n\tsudo systemctl daemon-reload\n\n\techo \"Checking status of ${service_name} service...\"\n\tsudo systemctl status ${service_name}\n}\n\n# Service One\n# Editing these lines service user, groups and file paths\n\nservice_name=\"automatic1111\"\nservice_desc=\"Automatic 1111 Stable Diffusion\"\nservice_user=\"username\"\nservice_group=\"username\"\nworking_dir=\"/home/username/stable-diffusion-webui\"\nexec_start=\"/home/username/stable-diffusion-webui/webui.sh\"\n\nwrite_service_config\n\n# Service Two\n# Editing these lines service user, groups and file paths\n\nservice_name=\"comfyui\"\nservice_desc=\"ComfyUI Stable Diffusion\"\nservice_user=\"username\"\nservice_group=\"username\"\nworking_dir=\"/home/username/ComfyUI\"\nexec_start=\"/home/username/ComfyUI/start.sh\"\n\nwrite_service_config\n```\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsec%2Fsdnotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradsec%2Fsdnotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradsec%2Fsdnotes/lists"}