Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you use the custom model from the network volume? #48

Open
kilimchoi opened this issue Jul 30, 2024 · 7 comments
Open

How do you use the custom model from the network volume? #48

kilimchoi opened this issue Jul 30, 2024 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@kilimchoi
Copy link

kilimchoi commented Jul 30, 2024

I was wondering how you make an API request to use the custom model from the network volume. It seems that if we use

{"input": ..., "4":{
  "inputs":{
     "ckpt_name":"realistic_vision_v5.1.safetensors"},
      "class_type":"CheckpointLoaderSimple"
   }
}

it just uses whatever model was included in the image. I added the network volume in the endpoint configuration on runpod btw.

@TimPietrusky TimPietrusky self-assigned this Jul 30, 2024
@TimPietrusky TimPietrusky added the documentation Improvements or additions to documentation label Jul 30, 2024
@TimPietrusky
Copy link
Member

TimPietrusky commented Jul 30, 2024

@kilimchoi so this should work like this:

  • The network volume is mounted as /runpod-volume into the serverless ComfyUI instance
  • Add your model to the network volume, for example into a folder called checkpoints with the model realistic_vision_v5.1.safetensors
  • Then it should look like this in your workflow:
{
  "input": {
     "4": {
       "inputs": {
         "ckpt_name":"/runpod-volume/checkpoints/realistic_vision_v5.1.safetensors"
       },
      "class_type":"CheckpointLoaderSimple"
     }
  }
}

@TimPietrusky
Copy link
Member

@kilimchoi I'm reopening the issue, as I want to document this also in the README.

@TimPietrusky TimPietrusky reopened this Jul 30, 2024
@dannykok
Copy link

dannykok commented Aug 2, 2024

It's kind of strange that I can load the custom model by using only the file name (without path). When I tried to use the full path of model file:

        "4": {
          "inputs": {
            "ckpt_name": "/runpod-volume/models/checkpoints/personaStyle_lite.safetensors"
          },
          "class_type": "CheckpointLoaderSimple"
        },

I got 400 bad request error. The logs show this:

Value not in list: ckpt_name: '/runpod-volume/models/checkpoints/personaStyle_lite.safetensors' not in ['personaStyle_lite.safetensors', 'sd_xl_base_1.0.safetensors']

I am using the timpietruskyblibla/runpod-worker-comfy:3.0.0-sdxl docker.

@TimPietrusky
Copy link
Member

@dannykok @kilimchoi what I wrote is wrong, I totally forgot about the mapping that we are doing in extra_model_paths.yaml. So you can just specify the name of the model, you don't need to specify the path.

I will make sure to get the README updated to make this clear.

@albertogb9
Copy link

I tried with and without the path but the network volume isn't being recognized by the worker

@dannykok
Copy link

@albertogb9 you may want to check if the path you used exists in extra_model_paths.yaml.

@albertogb9
Copy link

@albertogb9 you may want to check if the path you used exists in extra_model_paths.yaml.

Already figured it out. I had installed comfyui in the network volume, so the path was "ComfyUI/models/..." whereas it should be just "models/...". So I just created another network volume with a pytorch template and I created the models folders from scratch and loaded the checkpoints. Now it works fine, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants