apply lint
This commit is contained in:
parent
cc7cafabfd
commit
1289c560bd
|
@ -4,7 +4,6 @@ from os import path
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
|
||||||
from ..params import DeviceParams, ImageParams, StageParams, UpscaleParams
|
from ..params import DeviceParams, ImageParams, StageParams, UpscaleParams
|
||||||
from ..server.device_pool import JobContext
|
from ..server.device_pool import JobContext
|
||||||
from ..utils import ServerContext, run_gc
|
from ..utils import ServerContext, run_gc
|
||||||
|
|
|
@ -76,9 +76,7 @@ def load_resrgan(
|
||||||
logger.debug("loading Real ESRGAN upscale model from %s", model_path)
|
logger.debug("loading Real ESRGAN upscale model from %s", model_path)
|
||||||
|
|
||||||
# TODO: shouldn't need the PTH file
|
# TODO: shouldn't need the PTH file
|
||||||
model_path_pth = path.join(
|
model_path_pth = path.join(server.cache_path, ("%s.pth" % params.upscale_model))
|
||||||
server.cache_path, ("%s.pth" % params.upscale_model)
|
|
||||||
)
|
|
||||||
upsampler = RealESRGANer(
|
upsampler = RealESRGANer(
|
||||||
scale=params.scale,
|
scale=params.scale,
|
||||||
model_path=model_path_pth,
|
model_path=model_path_pth,
|
||||||
|
|
|
@ -20,7 +20,7 @@ from diffusers import (
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from diffusers import DEISMultistepScheduler
|
from diffusers import DEISMultistepScheduler
|
||||||
except:
|
except ImportError:
|
||||||
from .stub_scheduler import StubScheduler as DEISMultistepScheduler
|
from .stub_scheduler import StubScheduler as DEISMultistepScheduler
|
||||||
|
|
||||||
from ..params import DeviceParams, Size
|
from ..params import DeviceParams, Size
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
|
||||||
class StubScheduler():
|
class StubScheduler:
|
||||||
def step(self, model_output: Any, timestep: int, sample: Any, return_dict: bool = True) -> None:
|
def step(
|
||||||
raise NotImplemented("scheduler not available, try updating diffusers")
|
self, model_output: Any, timestep: int, sample: Any, return_dict: bool = True
|
||||||
|
) -> None:
|
||||||
|
raise NotImplementedError("scheduler not available, try updating diffusers")
|
||||||
|
|
Loading…
Reference in New Issue