Bing-su / adetailer

Auto detecting, masking and inpainting with detection model.
GNU Affero General Public License v3.0
4.09k stars 318 forks source link

[Feature Request]: Distilled CFG in Forge (Flux) #713

Open Jonseed opened 4 days ago

Jonseed commented 4 days ago

Is your feature request related to a problem? Please describe.

You can't properly use adetailer in Forge with Flux, because distilled CFG setting is missing. It seems to default to 3.5, but there is no way to adjust it.

Describe the solution you'd like

Add distilled CFG setting to adetailer when using Forge (Flux).

Describe alternatives you've considered

Settle for 3.5, or change the default somewhere. Not sure where (I tried ui-config.json, but that didn't change it when adetailer ran).

Additional context

No response

dosubot[bot] commented 4 days ago

Hey @Jonseed! I'm here to assist you with any bugs, questions, or contributions you might have. Let me know how I can help!

You can add a distilled CFG setting to ADetailer when using Forge (Flux). The existing code already supports a separate CFG scale setting. You can enable and configure it using the following parameters:

  1. ad_use_cfg_scale: Set this to True to enable the use of a separate CFG scale.
  2. ad_cfg_scale: Set this to the desired CFG scale value.

Here is an example of how you can configure these settings:

adetailer_args = ADetailerArgs(
    ad_use_cfg_scale=True,
    ad_cfg_scale=7.5  # Set this to your desired CFG scale value
)

Additionally, if you are using the UI components, you can configure these settings as follows:

with gr.Column(variant="compact"):
    w.ad_use_cfg_scale = gr.Checkbox(
        label="Use separate CFG scale" + suffix(n),
        value=False,
        visible=True,
        elem_id=eid("ad_use_cfg_scale"),
    )

    w.ad_cfg_scale = gr.Slider(
        label="ADetailer CFG scale" + suffix(n),
        minimum=0.0,
        maximum=30.0,
        step=0.5,
        value=7.0,
        visible=True,
        elem_id=eid("ad_cfg_scale"),
    )

    w.ad_use_cfg_scale.change(
        gr_interactive,
        inputs=w.ad_use_cfg_scale,
        outputs=w.ad_cfg_scale,
        queue=False,
    )

This configuration will enable and set the separate CFG scale for ADetailer [1][2].

To continue talking to Dosu, mention @dosu.

Bing-su commented 1 day ago

I can't add features that are only possible in forge. If automatic1111 adds flux support, I'll consider it. sorry.

Jonseed commented 18 hours ago

Why not? Maybe there could be a Forge/Flux branch? It seems many people have moved on from Automatic1111, which may never support Flux.