Skip to content

Commit

Permalink
fix type errors, remove logs
Browse files Browse the repository at this point in the history
  • Loading branch information
painebenjamin committed Dec 14, 2023
1 parent 94ac520 commit addb27e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/python/enfugue/diffusion/invocation/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ def pasted_image_callback(images: List[Image]) -> None:
from enfugue.diffusion.util import interpolate_frames, reflect_frames
with pipeline.interpolator.film() as interpolate:
if self.interpolate_frames:
if task_callback:
if task_callback is not None:
task_callback("Interpolating")
result["frames"] = [
frame for frame in interpolate_frames(
Expand All @@ -1266,7 +1266,7 @@ def pasted_image_callback(images: List[Image]) -> None:
else:
result["frames"] = result["images"]
if self.reflect:
if task_callback:
if task_callback is not None:
task_callback("Reflecting")
result["frames"] = [
frame for frame in reflect_frames(
Expand Down
9 changes: 4 additions & 5 deletions src/python/enfugue/diffusion/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def open_image(cls, path: str) -> List[PIL.Image.Image]:
return [PIL.Image.open(path)]

@classmethod
def get_config_from_url(cls, cache_dir: dir, url: dir) -> Dict[str, Any]:
def get_config_from_url(cls, cache_dir: str, url: str) -> Dict[str, Any]:
"""
Downloads remote config and loads it
"""
Expand Down Expand Up @@ -541,7 +541,6 @@ def from_ckpt(
cache_dir,
"https://huggingface.co/segmind/Segmind-Vega/raw/main/unet/config.json?filename=segmind-vega-unet-config.json"
)
logger.critical(unet_config)
else:
unet_config = create_unet_diffusers_config(original_config, image_size=image_size)

Expand Down Expand Up @@ -624,7 +623,7 @@ def from_ckpt(
check_size=False
)
task_callback("Loading VAE")
VAE_Config = AutoencoderKL._dict_from_json_file(vae_config_path)
vae_config = AutoencoderKL._dict_from_json_file(vae_config_path)
if "scaling_factor" in vae_config:
vae_config["scaling_factor"] = cls.get_vae_scale_factor(vae_config["scaling_factor"])
vae = AutoencoderKL.from_config(vae_config)
Expand Down Expand Up @@ -3485,9 +3484,9 @@ def __call__(

# Open images if they're files
if isinstance(image, str):
image = self.open_image(image)
image = self.open_image(image) # type: ignore[unreachable]
if isinstance(mask, str):
mask = self.open_image(mask)
mask = self.open_image(mask) # type: ignore[unreachable]

if image is not None and type(image) is not torch.Tensor:
if isinstance(image, list):
Expand Down

0 comments on commit addb27e

Please sign in to comment.