File size: 1,310 Bytes
564df58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from backend.annotators.canny_control import CannyControl
from backend.annotators.depth_control import DepthControl
from backend.annotators.lineart_control import LineArtControl
from backend.annotators.mlsd_control import MlsdControl
from backend.annotators.normal_control import NormalControl
from backend.annotators.pose_control import PoseControl
from backend.annotators.shuffle_control import ShuffleControl
from backend.annotators.softedge_control import SoftEdgeControl


class ImageControlFactory:
    def create_control(self, controlnet_type: str):
        if controlnet_type == "Canny":
            return CannyControl()
        elif controlnet_type == "Pose":
            return PoseControl()
        elif controlnet_type == "MLSD":
            return MlsdControl()
        elif controlnet_type == "Depth":
            return DepthControl()
        elif controlnet_type == "LineArt":
            return LineArtControl()
        elif controlnet_type == "Shuffle":
            return ShuffleControl()
        elif controlnet_type == "NormalBAE":
            return NormalControl()
        elif controlnet_type == "SoftEdge":
            return SoftEdgeControl()
        else:
            print("Error: Control type not implemented!")
            raise Exception("Error: Control type not implemented!")