NCJ commited on
Commit
db6ca6b
1 Parent(s): e58ea57

fix config save bug

Browse files
Files changed (1) hide show
  1. neuraltexture_controlnet.py +7 -2
neuraltexture_controlnet.py CHANGED
@@ -1,7 +1,9 @@
1
  from typing import Optional, Tuple, Union
2
 
3
  import torch
4
- from diffusers.configuration_utils import register_to_config
 
 
5
  from diffusers.models.controlnet import ControlNetModel, zero_module
6
  from diffusers.models.embeddings import (
7
  TextImageProjection,
@@ -193,7 +195,10 @@ class NeuralTextureControlNetModel(ControlNetModel):
193
  addition_embed_type_num_heads: int = 64,
194
  shading_hint_channels: int = 12,
195
  ):
196
- super().__init__()
 
 
 
197
 
198
  num_attention_heads = num_attention_heads or attention_head_dim
199
 
 
1
  from typing import Optional, Tuple, Union
2
 
3
  import torch
4
+ from diffusers.configuration_utils import ConfigMixin, register_to_config
5
+ from diffusers.loaders.controlnet import FromOriginalControlNetMixin
6
+ from diffusers.models.modeling_utils import ModelMixin
7
  from diffusers.models.controlnet import ControlNetModel, zero_module
8
  from diffusers.models.embeddings import (
9
  TextImageProjection,
 
195
  addition_embed_type_num_heads: int = 64,
196
  shading_hint_channels: int = 12,
197
  ):
198
+ # avoid running __init__() of the original ControlNetModel
199
+ super(ModelMixin, self).__init__()
200
+ super(ConfigMixin, self).__init__()
201
+ super(FromOriginalControlNetMixin, self).__init__()
202
 
203
  num_attention_heads = num_attention_heads or attention_head_dim
204