kohya-ss / sd-webui-additional-networks

GNU Affero General Public License v3.0
1.78k stars 296 forks source link

Calling additional networks from the webui API #161

Open unoriginalscreenname opened 1 year ago

unoriginalscreenname commented 1 year ago

I'm attempting to call the additional networks functionality from the webui API and it doesn't seem to be working. Here is the example payload I'm sending:

{ "prompt": "a puppy", "steps": 20, "extra_generation_params": { "AddNet Enabled": true, "AddNet Module 1": "lora", "AddNet Model 1": "cjmstylebaselineimg-80itr-60lr-0005tun-05nr-5__v2-1", "AddNet Weight A 1": 1, "AddNet Weight B 1": 1 }, "save_images":true }

Can someone help me understand why this isn't triggering the plugin?

What I would really like to do is be able to programmatically call the webui xyz script and use the additional networks models in the Y position. But it seems that I can't get the "AddNet Enabled" flag to be true. What am I missing? This is my first time playing with the API, and the documentation is pretty lean.

sanguinedab commented 1 year ago

I'm attempting to call the additional networks functionality from the webui API and it doesn't seem to be working. Here is the example payload I'm sending:

{ "prompt": "a puppy", "steps": 20, "extra_generation_params": { "AddNet Enabled": true, "AddNet Module 1": "lora", "AddNet Model 1": "cjmstylebaselineimg-80itr-60lr-0005tun-05nr-5__v2-1", "AddNet Weight A 1": 1, "AddNet Weight B 1": 1 }, "save_images":true }

Can someone help me understand why this isn't triggering the plugin?

What I would really like to do is be able to programmatically call the webui xyz script and use the additional networks models in the Y position. But it seems that I can't get the "AddNet Enabled" flag to be true. What am I missing? This is my first time playing with the API, and the documentation is pretty lean.

Hey guy, did you succeed in the end, I use the alwayson_scripts parameter and I can call controlnet, but I don't know how to use lora through the api way

ouyezi commented 1 year ago

"alwayson_scripts": { "Additional networks for generating":{ "args":[true, false, "LoRA","wwyzzz(911858b0fc79)",0.3,0.3, "LoRA","lq(da284acd3b8a)",0.3,0.3, "LoRA","None",1,1, "LoRA","None",1,1, "LoRA","None",1,1] },

You can try like this.

millerwang2022 commented 1 year ago

"alwayson_scripts": { "Additional networks for generating":{ "args":[true, false, "LoRA","wwyzzz(911858b0fc79)",0.3,0.3, "LoRA","lq(da284acd3b8a)",0.3,0.3, "LoRA","None",1,1, "LoRA","None",1,1, "LoRA","None",1,1] },

You can try like this.

How to call Extra args in additional networks through the API? Thank you very much

icarus0508 commented 10 months ago

Hi ,did you solve your problem? How to get lora models for Additional Network? since the lora folder is different from standard SD folder?

xiaotai1 commented 8 months ago

"alwayson_scripts": { "Additional networks for generating":{ "args":[true, false, "LoRA","wwyzzz(911858b0fc79)",0.3,0.3, "LoRA","lq(da284acd3b8a)",0.3,0.3, "LoRA","None",1,1, "LoRA","None",1,1, "LoRA","None",1,1] }

In this way, you can execute the Lora script?