1
0
Fork 0

use a proper fake config class

This commit is contained in:
Sean Sube 2023-03-10 18:57:01 -06:00
parent df1504d9b0
commit cd11e8f3ab
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 7 additions and 3 deletions

View File

@ -65,6 +65,12 @@ def preprocess(image):
return image
class FakeConfig():
scaling_factor: float
def __init__(self) -> None:
self.scaling_factor = 0.08333
class OnnxStableDiffusionUpscalePipeline(StableDiffusionUpscalePipeline):
def __init__(
@ -78,9 +84,7 @@ class OnnxStableDiffusionUpscalePipeline(StableDiffusionUpscalePipeline):
max_noise_level: int = 350,
):
if hasattr(vae, "config") == False:
config = {}
setattr(config, "scaling_factor", 0.08333)
setattr(vae, "config", config)
setattr(vae, "config", FakeConfig())
super().__init__(vae, text_encoder, tokenizer, unet, low_res_scheduler, scheduler, max_noise_level)