huchenlei / sd-forge-ic-light

A1111/SD Forge extension for IC-Light
Apache License 2.0
196 stars 7 forks source link

[Bug:] API calls have issue with Background Source #5

Closed jetjodh closed 6 months ago

jetjodh commented 6 months ago

When I try to generate relit images with different light directions, I get the same image result back. Payloads Used(base64 removed):

{
    "info": "{\"prompt\": \"\", \"all_prompts\": [\"\"], \"negative_prompt\": \"\", \"all_negative_prompts\": [\"\"], \"seed\": 577086, \"all_seeds\": [577086], \"subseed\": 259970688, \"all_subseeds\": [259970688], \"subseed_strength\": 0, \"width\": 512, \"height\": 512, \"sampler_name\": \"Euler\", \"cfg_scale\": 2.0, \"steps\": 25, \"batch_size\": 1, \"restore_faces\": false, \"face_restoration_model\": null, \"sd_model_name\": \"v1-5-pruned-emaonly\", \"sd_model_hash\": null, \"sd_vae_name\": \"vae-ft-mse-840000-ema-pruned.safetensors\", \"sd_vae_hash\": null, \"seed_resize_from_w\": -1, \"seed_resize_from_h\": -1, \"denoising_strength\": null, \"extra_generation_params\": {}, \"index_of_first_image\": 0, \"infotexts\": [\"Steps: 25, Sampler: Euler, CFG scale: 2.0, Seed: 577086, Size: 512x512, Model: v1-5-pruned-emaonly, VAE: vae-ft-mse-840000-ema-pruned.safetensors, RNG: CPU, Version: f0.0.17v1.8.0rc-1.7.0\"], \"styles\": [], \"job_timestamp\": \"20240513193059\", \"clip_skip\": 1, \"is_using_inpainting_conditioning\": false, \"version\": \"f0.0.17v1.8.0rc-1.7.0\"}",
    "payload": "{\"prompt\":\"\",\"external_models\":[],\"alwayson_scripts\":{\"IC Light\":{\"args\":[{\"enabled\":true,\"model_type\":\"FC\",\"input_fg\":\"base64\",\"uploaded_bg\":\"upl-515c91c7-2690-4ffe-b6ca-379e55915915\",\"bg_source_fbc\":\"Top Light\"}]}},\"cfg_scale\":2,\"override_settings\":{\"sd_model_checkpoint\":\"v1-5-pruned-emaonly.safetensors\",\"sd_vae\":\"vae-ft-mse-840000-ema-pruned.safetensors\"}"
  }
"info": "{\"prompt\": \"\", \"all_prompts\": [\"\"], \"negative_prompt\": \"\", \"all_negative_prompts\": [\"\"], \"seed\": 577086, \"all_seeds\": [577086], \"subseed\": 3704338650, \"all_subseeds\": [3704338650], \"subseed_strength\": 0, \"width\": 512, \"height\": 512, \"sampler_name\": \"Euler\", \"cfg_scale\": 2.0, \"steps\": 25, \"batch_size\": 1, \"restore_faces\": false, \"face_restoration_model\": null, \"sd_model_name\": \"v1-5-pruned-emaonly\", \"sd_model_hash\": null, \"sd_vae_name\": \"vae-ft-mse-840000-ema-pruned.safetensors\", \"sd_vae_hash\": null, \"seed_resize_from_w\": -1, \"seed_resize_from_h\": -1, \"denoising_strength\": null, \"extra_generation_params\": {}, \"index_of_first_image\": 0, \"infotexts\": [\"Steps: 25, Sampler: Euler, CFG scale: 2.0, Seed: 577086, Size: 512x512, Model: v1-5-pruned-emaonly, VAE: vae-ft-mse-840000-ema-pruned.safetensors, RNG: CPU, Version: f0.0.17v1.8.0rc-1.7.0\"], \"styles\": [], \"job_timestamp\": \"20240513192712\", \"clip_skip\": 1, \"is_using_inpainting_conditioning\": false, \"version\": \"f0.0.17v1.8.0rc-1.7.0\"}",
    "payload": "{\"prompt\":\"\",\"external_models\":[],\"alwayson_scripts\":{\"IC Light\":{\"args\":[{\"enabled\":true,\"model_type\":\"FC\",\"input_fg\":\"base64\",\"bg_source_fc\":\"Right Light\"}]}},\"cfg_scale\":2,\"override_settings\":{\"sd_model_checkpoint\":\"v1-5-pruned-emaonly.safetensors\",\"sd_vae\":\"vae-ft-mse-840000-ema-pruned.safetensors\"}"
huchenlei commented 6 months ago

If you want to upload a background, you need to use FBC model instead of FC model.

jetjodh commented 6 months ago

I'm not using an uploaded background, so using these params with FC model is the correct way?

huchenlei commented 6 months ago

You should call the API the same way you use the model on the GUI. If using FC model in txt2img, only None bg source is supported. If using FC model in img2img, the bg source actually does not matter, you should direcly set init_image(A1111 img2img image input) in the payload body to the lightmap you want to use.