Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds support for generating transparent images via layer diffusion #224

Merged
merged 27 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3f5f22c
chore(deps): bump the python-packages group across 1 directory with 1…
dependabot[bot] Jul 8, 2024
e2d079d
feat: download misc models
db0 Jun 30, 2024
23a53fa
fix: `FindUserResponse` -> `UserDetailsResponse`
tazlin Jun 30, 2024
e719d11
fix: use latest compat. horde deps
db0 Jun 30, 2024
f77c7bb
feat: repurposed allow_sdxl_controlnet to work for transparency as well
db0 Jun 30, 2024
a684b13
fix: `None` check for `job.payload.loras`
tazlin Jul 1, 2024
3dda453
style: fix
tazlin Jul 1, 2024
bccf320
chore: match pinned horde deps across all files
tazlin Jul 1, 2024
92098d7
fix: use hordelib w/ intended hires fix
tazlin Jul 8, 2024
e2e5402
chore: version bump
tazlin Jul 8, 2024
50d999e
fix: use more accurate calls to micromamba
tazlin Jul 12, 2024
d6f477d
fix: align intended versions
tazlin Jul 12, 2024
f48a235
chore: version bump
tazlin Jul 12, 2024
3062513
feat: better logs for inter process messages, model map, pausing
tazlin Jul 16, 2024
a05ee88
fix: use hordelib w/ new facerestore nodes
tazlin Jul 16, 2024
b258f30
chore: version bump
tazlin Jul 16, 2024
c390f15
fix: don't crash on job submit client errors
tazlin Jul 21, 2024
9433024
fix: use hires adjustments + cascade fix
tazlin Jul 21, 2024
5da7708
fix: use correct horde_engine version
tazlin Jul 21, 2024
726978b
fix: default to empty list where `loras` payload can now be null
tazlin Jul 21, 2024
4ae95a3
fix: avoid crashing while recording jobs when using no loras or TI
db0 Jul 21, 2024
e628135
fix: better deadlock detection
tazlin Jul 21, 2024
1e5c8f9
fix: don't overlap post proccessing w/ inference by default
tazlin Jul 21, 2024
4749273
style: fix
tazlin Jul 23, 2024
65bbc2a
fix: corner case `None` problem with `sys.__stdout__`
tazlin Jul 23, 2024
a0c8a48
chore: update dev deps
tazlin Jul 23, 2024
cf2252e
chore: version bump
tazlin Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ classes.svg

griffe.json

.venv*

.vscode/
.codiumai.toml

.venv*

micromamba.exe
micromamba.tar.bz2
info/
Expand Down Expand Up @@ -174,6 +178,7 @@ cython_debug/
bin/*
conda/*
models/*
models
clip_blip/*
hf_transformers/*
horde_model_reference/*
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.5.4
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
rev: 'v1.11.0'
hooks:
- id: mypy
args: []
additional_dependencies:
- pydantic==2.7.1
- pydantic==2.7.4
- types-requests
- types-pytz
- types-setuptools
Expand All @@ -40,7 +40,7 @@ repos:
- horde_safety==0.2.3
- torch==2.3.1
- ruamel.yaml
- horde_engine==2.11.1
- horde_sdk==0.10.0
- horde_model_reference==0.6.3
- horde_engine==2.13.3
- horde_sdk==0.14.0
- horde_model_reference==0.8.1
- semver
2 changes: 1 addition & 1 deletion bridgeData_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ allow_post_processing: true
# Note: There is additional RAM/VRAM overhead with this option. Low VRAM cards (<6gb) should be cautious to enable this.
allow_controlnet: false

# Allow SDXL controlnet jobs to be done by this worker.
# Allow SDXL jobs with high memory add-ons like controlnet or transparency to be done by this worker.
# Note: There is significant additional RAM/VRAM overhead with this option. Medium VRAM cards (<12gb) should be cautious to enable this.
# Note that if this is true, allow_controlnet must also be true
allow_sdxl_controlnet: false
Expand Down
2 changes: 1 addition & 1 deletion horde-bridge.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cd /d %~dp0
call runtime python -s -m pip -V

call python -s -m pip uninstall hordelib
call python -s -m pip install horde_sdk~=0.10.0 horde_model_reference~=0.6.3 horde_engine~=2.11.1 horde_safety~=0.2.3 -U
call python -s -m pip install horde_sdk~=0.14.0 horde_model_reference~=0.8.1 horde_engine~=2.13.3 horde_safety~=0.2.3 -U

if %ERRORLEVEL% NEQ 0 (
echo "Please run update-runtime.cmd."
Expand Down
2 changes: 1 addition & 1 deletion horde_worker_regen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

ASSETS_FOLDER_PATH = Path(__file__).parent / "assets"

__version__ = "7.0.4"
__version__ = "8.1.1"


import pkg_resources # noqa: E402
Expand Down
2 changes: 1 addition & 1 deletion horde_worker_regen/_version_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"recommended_version": "7.0.4",
"recommended_version": "8.1.1",
"required_min_version": "4.2.7",
"required_min_version_update_date": "2024-03-09",
"required_min_version_info": {
Expand Down
3 changes: 3 additions & 0 deletions horde_worker_regen/bridge_data/data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class reGenBridgeData(CombinedHordeBridgeData):
moderate_performance_mode: bool = Field(default=False)
"""If you have a 3080 or better, set this to true to enable moderate performance mode."""

post_process_job_overlap: bool = Field(default=False)
"""High and moderate performance modes will skip post processing if this is set to true."""

capture_kudos_training_data: bool = Field(default=False)
kudos_training_data_file: str | None = Field(default=None)

Expand Down
15 changes: 15 additions & 0 deletions horde_worker_regen/download_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ def download_all_models(
logger.error("Failed to download the controlnet annotators")
exit(1)

if bridge_data.allow_sdxl_controlnet:
if SharedModelManager.manager.miscellaneous is None:
logger.error("Failed to load miscellaneous model manager")
exit(1)
SharedModelManager.manager.miscellaneous.download_all_models()
SharedModelManager.manager.miscellaneous.download_all_models()
for model in SharedModelManager.manager.miscellaneous.model_reference:
if not SharedModelManager.manager.miscellaneous.validate_model(
model,
) and not SharedModelManager.manager.miscellaneous.download_model(model):
logger.error(f"Failed to download model {model}")
exit(1)
else:
logger.success("Downloaded all Miscellaneous models")

if bridge_data.allow_post_processing:
if SharedModelManager.manager.gfpgan is None:
logger.error("Failed to load GFPGAN model manager")
Expand Down
2 changes: 1 addition & 1 deletion horde_worker_regen/process_management/inference_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def download_aux_models(self, job_info: ImageGenerateJobPopResponse) -> float |

performed_a_download = False

loras = job_info.payload.loras
loras = job_info.payload.loras or []

try:
lora_manager.load_model_database()
Expand Down
6 changes: 5 additions & 1 deletion horde_worker_regen/process_management/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ def is_loaded(self) -> bool:
or self == ModelLoadState.IN_USE
)

def is_active(self) -> bool:
"""Return if the model is loaded in VRAM or in use."""
return self != ModelLoadState.ON_DISK


class ModelInfo(BaseModel):
"""Information about a model loaded or used by a process."""
Expand Down Expand Up @@ -121,7 +125,7 @@ class HordeProcessMessage(BaseModel):
process_id: int
"""The ID of the process that sent the message."""
info: str
"""Information about the process."""
"""Information about this operation sent the process."""
time_elapsed: float | None = None
"""The time elapsed since the process started."""

Expand Down
Loading
Loading