lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.36k stars 812 forks source link

Can the API call the Flux model? #1472

Closed qilan2 closed 1 day ago

qilan2 commented 2 months ago

How should I call it?

MkKsko commented 2 months ago

I tried it and got only a black image.

altoiddealer commented 2 months ago

For one, the extra modules (VAE, text encoders) cannot yet be included in override_settings (not defined / handled yet)

forReason commented 2 months ago

argh! this needs to be implemented

vinch00 commented 2 months ago

Passing scheduler as "Simple" in the API payload appears to be working: https://github.com/lllyasviel/stable-diffusion-webui-forge/issues/1221

altoiddealer commented 1 month ago

For one, the extra modules (VAE, text encoders) cannot yet be included in override_settings (not defined / handled yet)

I'm unsure exactly when this was added, but I noticed that Flux is now working via API.

The override_settings key now accepts a parameter forge_additional_modules - a list of paths to modules.

Here's a snippet I tested in my python script, which worked:

            override_settings = self.img_payload.setdefault('override_settings', {})
            override_settings['forge_additional_modules'] = [
                "D:\\0_AI\\stable-diffusion-webui-forge\\models\\text_encoder\\ae.safetensors",
                "D:\\0_AI\\stable-diffusion-webui-forge\\models\\text_encoder\\clip_l.safetensors",
                "D:\\0_AI\\stable-diffusion-webui-forge\\models\\text_encoder\\t5xxl_fp8_e4m3fn.safetensors"]
altoiddealer commented 3 weeks ago

You should close this as it is now easy to manage Flux related settings via API