Skip to content

Commit

Permalink
XXX: style: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Aug 27, 2023
1 parent e3558ec commit 8554eee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hordelib/comfy_horde.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def horde_load_checkpoint(
# XXX # This can remain a comfy call, but the rest of the code should be able
# XXX # to pretend it isn't
# Redirect IO
raise NotImplementedError()
raise NotImplementedError
try:
stdio = OutputCollector()
with contextlib.redirect_stdout(stdio):
Expand Down
7 changes: 4 additions & 3 deletions hordelib/model_manager/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import psutil
import requests
import torch
from horde_model_reference import MODEL_REFERENCE_CATEGORY, LEGACY_REFERENCE_FOLDER, get_model_reference_filename
from horde_model_reference import LEGACY_REFERENCE_FOLDER, MODEL_REFERENCE_CATEGORY, get_model_reference_filename
from loguru import logger
from tqdm import tqdm

Expand All @@ -29,7 +29,6 @@
from hordelib.consts import MODEL_CATEGORY_NAMES, MODEL_DB_NAMES, MODEL_FOLDER_NAMES, REMOTE_MODEL_DB
from hordelib.settings import UserSettings


_temp_reference_lookup = {
MODEL_CATEGORY_NAMES.codeformer: MODEL_REFERENCE_CATEGORY.codeformer,
MODEL_CATEGORY_NAMES.compvis: MODEL_REFERENCE_CATEGORY.stable_diffusion,
Expand Down Expand Up @@ -235,7 +234,9 @@ def ensure_ram_available(self):
logger.debug("Not enough free RAM attempting to free some")
# Grab a list of models (ModelPatcher) that are loaded on the gpu
# These are actually returned with the least important at the bottom of the list
busy_models = get_models_on_gpu()
def busy_models():
return None # get_models_on_gpu()

# Try to find one we have in ram that isn't on the gpu
idle_model = None
# idle_model_data = None
Expand Down
4 changes: 3 additions & 1 deletion hordelib/nodes/node_image_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def INPUT_TYPES(s):
def load_image(self, image):
new_image = image.convert("RGB")
new_image = np.array(new_image).astype(np.float32) / 255.0
new_image = torch.from_numpy(new_image)[None,]
new_image = torch.from_numpy(new_image)[
None,
]
if "A" in image.getbands():
mask = np.array(image.getchannel("A")).astype(np.float32) / 255.0
mask = 1.0 - torch.from_numpy(mask)
Expand Down

0 comments on commit 8554eee

Please sign in to comment.