ImDarkTom / ComfyUIMini

A web app made to let mobile users run ComfyUI workflows.
GNU Affero General Public License v3.0
80 stars 3 forks source link

How to configure model dir #4

Open hdxpmc opened 2 weeks ago

hdxpmc commented 2 weeks ago

when run, the console warn: [WARN] model_dirs.json not configured, you will be unable to select models until it is set. and exception when for this line: const selectListResponse = await fetch(/comfyui/listmodels/${inputOptions.select_list}); // /comfyui/listmodels/undefined

ImDarkTom commented 2 weeks ago

You need to add the paths for your models into the model_dirs.json file so it can correctly read and let you select from a model list when in the app.

When you open the model_dirs.json file it should look something like:

{
    "checkpoint": {
        "folder_path": "path/to/checkpoint/folder",
        "filetypes": [".ckpt", ".safetensors"]
    },
    ...
}

so for example, to let it be able to read your checkpoints directory, you would replace path/to/checkpoint/folder to the directory where you store your checkpoints e.g D:\\AI\\ComfyUI\\models\\checkpoint. (Note that on windows you will need to use two backslashes like \\ otherwise it will not work).

As for the exception that should be gone once you have correctly configured your model paths.

hdxpmc commented 2 weeks ago

we have update model_dirs.json (all \ is two \, in vs code it show two \) { "checkpoint": { "folder_path": "H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\checkpoints", "filetypes": [".ckpt", ".safetensors"] }, "vae": { "folder_path": "H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\vae", "filetypes": [".pt", ".safetensors"] }, "embedding": { "folder_path": "H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\embeddings", "filetypes": [".pt", ".safetensors"] }, "upscaler": { "folder_path": "H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\upscale_models", "filetypes": [".pth"] }, "lora": { "folder_path": "H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\loras", "filetypes": [".safetensors"] } } // the output warning: node .
[INFO] Found 0 workflows in the workflow folder. [WARN] Invalid directory for checkpoint in model_dirs.json [WARN] Invalid directory for vae in model_dirs.json [WARN] Invalid directory for embedding in model_dirs.json [WARN] Invalid directory for upscaler in model_dirs.json [WARN] Invalid directory for lora in model_dirs.json [INFO] Loaded 0 model types. [SUCCESS] Running on http://192.168.1.91:3000 [SUCCESS] 200: ComfyUI is running.

ImDarkTom commented 2 weeks ago

Are you sure you put the right path? Try checking if you can open H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\checkpoints in explorer because that is the only problem I can think of.

hdxpmc commented 1 week ago

Are you sure you put the right path? Try checking if you can open H:\D\ComfyUI_windows_portable_8_2024\ComfyUI\models\checkpoints in explorer because that is the only problem I can think of.

Yes, it is valid path (as following image). Does it need to run ComyUIMini on the same machine with ComfyUI ?

IMG_9374_1024

ImDarkTom commented 1 week ago

Does it need to run ComyUIMini on the same machine with ComfyUI ?

Yes, both ComfyUI and ComfyUIMini should be running on the same machine.

I'm currently working on being able to get the models from ComfyUI without the need to set them in a config in ComfyUIMini, so if you are still having issues you might want to wait until that has been implemented, but it might take a while as it'll require my pull request in the main ComfyUI repo to be accepted.