File size: 2,342 Bytes
194b4ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72


### API
API is available on `/replacer/replace`

```python
    input_image: str = "base64 image"
    detection_prompt: str = ""
    avoidance_prompt: str = ""
    positive_prompt: str = ""
    negative_prompt: str = ""
    width: int = 512
    height: int = 512
    sam_model_name: str = sam_model_list[0] if sam_model_list else ""
    dino_model_name: str = dino_model_list[0]
    seed: int = -1
    sampler: str = "DPM++ 2M SDE" if IS_WEBUI_1_9 else "DPM++ 2M SDE Karras"
    scheduler: str = "Automatic"
    steps: int = 20
    box_threshold: float = 0.3
    mask_expand: int = 35
    mask_blur: int = 4
    mask_num: str = "Random"
    max_resolution_on_detection = 1280
    cfg_scale: float = 5.5
    denoise: float = 1.0
    inpaint_padding = 40
    inpainting_mask_invert: bool = False
    upscaler_for_img2img : str = ""
    fix_steps : bool = False
    inpainting_fill : int = 0
    sd_model_checkpoint : str = ""
    clip_skip: int = 1
    rotation_fix: str = '-' # choices: '-', '⟲', '⟳', '🗘'
    extra_include: list = ["mask", "box", "cut", "preview", "script"]
    variation_seed: int = -1
    variation_strength: float = 0.0
    integer_only_masked: bool = False
    forbid_too_small_crop_region: bool = True
    correct_aspect_ratio: bool = True

    use_hires_fix: bool = False
    hf_upscaler: str = "ESRGAN_4x"
    hf_steps: int = 4
    hf_sampler: str = "Use same sampler"
    hf_scheduler: str = "Use same scheduler"
    hf_denoise: float = 0.35
    hf_cfg_scale: float = 1.0
    hf_positive_prompt_suffix: str = "<lora:lcm-lora-sdv1-5:1>"
    hf_size_limit: int = 1800
    hf_above_limit_upscaler: str = "Lanczos"
    hf_unload_detection_models: bool = True
    hf_disable_cn: bool = True
    hf_extra_mask_expand: int = 5
    hf_positive_prompt: str = ""
    hf_negative_prompt: str = ""
    hf_sd_model_checkpoint: str = "Use same checkpoint"
    hf_extra_inpaint_padding: int = 250
    hf_extra_mask_blur: int = 2
    hf_randomize_seed: bool = True
    hf_soft_inpaint: str = "Same"
    hf_supersampling: float = 1.6

    scripts : dict = {} # ControlNet and Soft Inpainting. See apiExample.py for example
```

Available options on `/replacer/available_options`

http://127.0.0.1:7860/docs#/default/api_replacer_replace_replacer_replace_post

See an example of usage in [apiExample.py](/apiExample.py) script