tctien342 / comfyui-sdk

SDK for ComfyUI
MIT License
39 stars 8 forks source link

about test examples/example-t2i.ts can't found model? #2

Closed zhanghongyong123456 closed 2 months ago

zhanghongyong123456 commented 2 months ago

Value not in list: ckpt_name: ckpt_name: 'SDXL/realvisxlV40_v40LightningBakedvae.safetensors' not in (list of length 202) ,but in comfyui ,i can run use
SDXL/realvisxlV40_v40LightningBakedvae.safetensors

tctien342 commented 2 months ago

@zhanghongyong123456 is your realvisxlV40_v40LightningBakedvae.safetensors checkpoint is placed in SDXL folder ?, try to import the example-txt2img-workflow.json into your ComfyUI to see if it work

tctien342 commented 2 months ago

It may work on your side because comfyui have replace the SDXL/realvisxlV40_v40LightningBakedvae.safetensors with valid one, you can export that into json again after render success and correct the value from your json.

tctien342 commented 2 months ago

You can get list of working checkpoint's values like this:

const client = new ComfyApi("http://localhost:8188");
await client.getCheckpoints().then(console.log);
zhanghongyong123456 commented 2 months ago

You can get list of working checkpoint's values like this:

const client = new ComfyApi("http://localhost:8188");
await client.getCheckpoints().then(console.log);

I found out that this model does exist, is it possible/different from \ image

tctien342 commented 2 months ago

@zhanghongyong123456 I think your client running on Windows, i have not test it yet. Please try with values you got from getCheckpoints fn to see if it work.

zhanghongyong123456 commented 2 months ago

@zhanghongyong123456 I think your client running on Windows, i have not test it yet. Please try with values you got from getCheckpoints fn to see if it work.

I replace '/' to '\' can run, this code inside how to set, can avoid manual modification

tctien342 commented 2 months ago

I have update the PromptBuilder so you can call like this for automate encode the model path on input:

const workflow = promptBuilder
  .input(
    "checkpoint",
    "SDXL/realvisxlV40_v40LightningBakedvae.safetensors",
    /**
     * Use the client's osType to encode the path
     *
     * For example, if the client's `osType` is "nt" (Windows), the path should be encoded as below
     * "SDXL\\realvisxlV40_v40LightningBakedvae.safetensors"
     */
    api.osType // This is optional, but recommended it you want to support multiple platforms
  )
  .input("positive", "A beautiful landscape")
  .input("negative", "blurry, text")
  .input("seed", 42)
  .input("steps", 20);

The api.osType is exposed from client for getting the os type of that node.