Skip to content

local_settings

Local Launch Settings for the addon.

ComfyLocalProfile

Bases: BaseSettingsModel

Specifies launch arguments / extra dirs.

Source code in server/local_settings.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
class ComfyLocalProfile(BaseSettingsModel):
    """Specifies launch arguments / extra dirs."""

    comfy_is_windows_portable: bool = SettingsField(
        default=True,
        title="Is windows path a 'portable windows' build?",
        description=(
            "On windows, if the designated folder is a windows portable build "
            "the plugin will look for python in python_embeded and add the "
            "--windows-portable flag to launch arguments."
        ),
    )

    dev_omit_packaged_ayon_comfyui_plugin: bool = SettingsField(
        default=False, title="Omit included plugin (use for developing)"
    )

    launch_args_win: list[LaunchArgsMappingModel] = SettingsField(
        default_factory=list,
        title="Launch arguments for Windows",
        description="Extra launch arguments for Windows",
    )

    launch_args_lin: list[LaunchArgsMappingModel] = SettingsField(
        default_factory=list,
        title="Launch arguments for Linux",
        description="Extra launch arguments for Linux",
    )

    launch_args_osx: list[LaunchArgsMappingModel] = SettingsField(
        default_factory=list,
        title="Launch arguments for MacOsx",
        description="Extra launch arguments for MacOsx",
    )

    extra_dirs: list[LocalProfileDirMapping] = SettingsField(
        default_factory=list,
        title="Extra directories",
        description=(
            "Extra directories for ComfyUI to search through. "
            "These get added to the generated configuration YAML at start."
        ),
    )

    @validator("extra_dirs")
    def validate_unique_names_dirs(cls, value):
        ensure_unique_names(value)
        return value

ComfyLocalSetting

Bases: BaseSettingsModel

Comfy Local Executable & Launch profiles settings.

Source code in server/local_settings.py
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
class ComfyLocalSetting(BaseSettingsModel):
    """Comfy Local Executable & Launch profiles settings."""

    name: str = SettingsField("", title="Setting name")

    comfy_launch_port: int = SettingsField(
        default=8188,
        title="Port for ComfyUI (default = 8188)",
        description=(
            "Comfyui will be launched on http://127.0.0.1:port, "
            "with http://127.0.0.1:8188 being the default."
        ),
    )

    comfy_base_folder_win: str = SettingsField(
        "", title="ComfyUI folder on windows."
    )
    comfy_base_folder_lin: str = SettingsField(
        "", title="ComfyUI folder on Linux."
    )
    comfy_base_folder_osx: str = SettingsField(
        "", title="ComfyUI folder on MacOsx."
    )

    python_path_use_custom: bool = SettingsField(
        default=False,
        title="Use alternate python?",
        description=(
            "If using Comfy UI as is from the git repository, "
            "toggle this to use a different python executable."
        ),
    )

    python_use_managed_venv: bool = SettingsField(
        default=True,
        title="Use managed virtual environment with python",
        description=(
            "If not on windows, use either a specified installation of python "
            "when 'Use alternate python' is enabled, or the default version "
            "that shows up on execution of 'python' in the console, to make "
            "a virtual environment in the AYON folder that holds all "
            "dependencies."
        ),
    )

    python_path_win: str = SettingsField(
        "", title="Windows", description="Windows custom ComfyUI python path"
    )
    python_path_lin: str = SettingsField(
        "", title="Linux", description="Linux custom ComfyUI python path"
    )
    python_path_osx: str = SettingsField(
        "", title="MacOsx", description="MacOsx custom ComfyUI python path"
    )

    launch_profile: ComfyLocalProfile = SettingsField(
        default_factory=ComfyLocalProfile, title="Launch configuration"
    )

ComfyLocalSettings

Bases: BaseSettingsModel

Group together settings.

Source code in server/local_settings.py
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
class ComfyLocalSettings(BaseSettingsModel):
    """Group together settings."""

    # Port settings
    http_server_port: int = SettingsField(
        5454,
        title="Default port for website user interacts with.",
        description=(
            "This port is used to launch a wrapper website "
            "for ComfyUI. This websites hosts an <iframe> the "
            "'real' ComfyUI will be embedded in."
        ),
    )

    server_pulse_port: int = SettingsField(
        55055,
        title="Default port to pulse connection to backend",
        description=(
            "Websocket port to send heartbeat over, to make sure the backend "
            "process is still alive"
        ),
    )

    frontend_port: int = SettingsField(
        55056,
        title="Default port for frontend websocket RPC",
        description=(
            "Websocket port to communicate with local browser instance"
        ),
    )

    local_setting_list: list[ComfyLocalSetting] = SettingsField(
        default_factory=list, title="Local configuration entry"
    )

    @validator("local_setting_list")
    def validate_unique_names_localsettings(cls, value):
        ensure_unique_names(value)
        return value

LaunchArgsMappingModel

Bases: BaseSettingsModel

Model for launch arguments.

Source code in server/local_settings.py
101
102
103
104
105
106
107
class LaunchArgsMappingModel(BaseSettingsModel):
    """Model for launch arguments."""

    _layout = "compact"
    # No default for key, must have value
    key: str = SettingsField(title="Key")
    value: str = SettingsField("", title="Value (can be empty)")

LocalProfileDirMapping

Bases: BaseSettingsModel

Stores directories for extra config generation.

Source code in server/local_settings.py
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
class LocalProfileDirMapping(BaseSettingsModel):
    """Stores directories for extra config generation."""

    enabled: bool = SettingsField(True)  # noqa: FBT003

    name: str = SettingsField(
        "",
        title="Name",
        description=("Name used for alias during diagnostics."),
    )

    dir_type: str = SettingsField(
        default="auto",
        title="Folder type",
        enum_resolver=lambda: DIR_TYPES_ENUM,
        description=(
            "Specify what kind of directory is added. "
            "The directory type specifies what type of files ComfyUI "
            "expects to be present there. 'Automatic' looks in the "
            "subdirectory for valid ComfyUI directories using the expected "
            "names that ComfyUI/folderpaths.py can expect."
        ),
    )

    dirs_win: list[str] = SettingsField(
        default_factory=list,
        title="Custom directories windows",
        description="Add windows directories that ComfyUI may search through.",
    )
    dirs_lin: list[str] = SettingsField(
        default_factory=list,
        title="Custom directories linux",
        description="Add linux directories that ComfyUI may search through.",
    )
    dirs_osx: list[str] = SettingsField(
        default_factory=list,
        title="Custom directories MacOsx",
        description="Add MacOsx directories that ComfyUI may search through.",
    )