ekhatskevich commited on
Commit
fc8037f
·
1 Parent(s): 8a1f3fc

add configuration

Browse files
Files changed (2) hide show
  1. app.py +3 -12
  2. models/model_zoo.yaml +28 -0
app.py CHANGED
@@ -11,18 +11,9 @@ os.environ["LOCAL_MODEL_PATH"] = "ms://iic/ACE_Plus@local_editing/comfyui_local_
11
  from inference.ace_plus_inference import ACEInference
12
  from scepter.modules.utils.config import Config
13
 
14
- config_dict = {
15
- "MODEL": {
16
- "type": "ACE",
17
- "pretrained_path": os.getenv("PORTRAIT_MODEL_PATH")
18
- },
19
- "MAX_SEQ_LEN": 77,
20
- "SAMPLE_ARGS": {
21
- "prompt": "Face swap"
22
- },
23
- "DTYPE": "bfloat16"
24
- }
25
- cfg = Config(config_dict)
26
 
27
  # Instantiate the ACEInference object.
28
  ace_infer = ACEInference(cfg)
 
11
  from inference.ace_plus_inference import ACEInference
12
  from scepter.modules.utils.config import Config
13
 
14
+
15
+ config_path = os.path.join("models", "model_zoo.yaml")
16
+ cfg = Config(load=True, cfg_file=config_path)
 
 
 
 
 
 
 
 
 
17
 
18
  # Instantiate the ACEInference object.
19
  ace_infer = ACEInference(cfg)
models/model_zoo.yaml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MODEL:
2
+ PORTRAIT:
3
+ MODEL_PATH: ${PORTRAIT_MODEL_PATH}
4
+ SUBJECT:
5
+ MODEL_PATH: ${SUBJECT_MODEL_PATH}
6
+ LOCAL_EDITING:
7
+ MODEL_PATH: ${LOCAL_MODEL_PATH}
8
+ REPAINTING_SCALE: 0.5
9
+ PREPROCESSOR:
10
+ - NAME: CannyAnnotator
11
+ TYPE: canny_repaintingß
12
+ LOW_THRESHOLD: 100
13
+ HIGH_THRESHOLD: 200
14
+ - NAME: ColorAnnotator
15
+ TYPE: mosaic_repainting
16
+ RATIO: 64
17
+ - NAME: InfoDrawContourAnnotator
18
+ TYPE: contour_repainting
19
+ INPUT_NC: 3
20
+ OUTPUT_NC: 1
21
+ N_RESIDUAL_BLOCKS: 3
22
+ SIGMOID: True
23
+ PRETRAINED_MODEL: "ms://iic/scepter_annotator@annotator/ckpts/informative_drawing_contour_style.pth"
24
+ - NAME: MidasDetector
25
+ PRETRAINED_MODEL: "ms://iic/scepter_annotator@annotator/ckpts/dpt_hybrid-midas-501f0c75.pt"
26
+ TYPE: depth_repainting
27
+ - NAME: GrayAnnotator
28
+ TYPE: recolorizing