mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
25 lines
609 B
Python
25 lines
609 B
Python
import torch
|
|
from diffusers.configuration_utils import ConfigMixin, register_to_config
|
|
from torch import nn
|
|
|
|
|
|
class ModuleDict(torch.nn.Module):
|
|
def __init__(self, module_dict):
|
|
super(ModuleDict, self).__init__()
|
|
for name, module in module_dict.items():
|
|
self.add_module(name, module)
|
|
|
|
|
|
class ObjectDict:
|
|
def __init__(self, module_dict):
|
|
for name, module in module_dict.items():
|
|
setattr(self, name, module)
|
|
|
|
|
|
class Dummy(nn.Module, ConfigMixin):
|
|
config_name = "config.json"
|
|
|
|
@register_to_config
|
|
def __init__(self):
|
|
super().__init__()
|