Skip to content

dirty hack to allow clip skip override from api#3629

Closed
evshiron wants to merge 1 commit into
AUTOMATIC1111:masterfrom
evshiron:master
Closed

dirty hack to allow clip skip override from api#3629
evshiron wants to merge 1 commit into
AUTOMATIC1111:masterfrom
evshiron:master

Conversation

@evshiron

Copy link
Copy Markdown
Contributor

No description provided.

@AUTOMATIC1111

Copy link
Copy Markdown
Owner

I added an alternate solution which lets you specify settings for the duration of generation in api via the override_settings:

{
  ...
  "override_settings": {"CLIP_stop_at_last_layers": 2},
  ...
}

@evshiron

Copy link
Copy Markdown
Contributor Author

This is much better. Thanks for your work.

@evshiron evshiron closed this Oct 26, 2022
@evshiron evshiron mentioned this pull request Oct 29, 2022
@aliencaocao

Copy link
Copy Markdown
Contributor

Hi does this override_settings argument also allows for overriding other options? I need to override the hypernetwork

@evshiron

Copy link
Copy Markdown
Contributor Author

@aliencaocao Yes. See here:

"sd_hypernetwork": OptionInfo("None", "Hypernetwork", gr.Dropdown, lambda: {"choices": ["None"] + [x for x in hypernetworks.keys()]}, refresh=reload_hypernetworks),

@aliencaocao

aliencaocao commented Oct 30, 2022

Copy link
Copy Markdown
Contributor

So do I just pass sd_hypernetwork and the value into override settings? Because ive tried doing this and nothing is taking effect. I have both the CLIP last layer and sd_hypernetwork in the override settings, but only the CLIP one is taking effect. Im passing in the value as shown in the drop down. Currently i have to send the entire settings dict to /api/predict as if i modify the settings from UI.

@evshiron

Copy link
Copy Markdown
Contributor Author

@aliencaocao I am sorry that I was wrong.

opts.data[k] = v # we don't call onchange for simplicity which makes changing model, hypernet impossible

This is the overriding part at the moment (see the comment). If we call shared.reload_hypernetworks() here, the hypernetwork override will take effect.

@aliencaocao

Copy link
Copy Markdown
Contributor

I see, so actually beside hypernet, most other settings that does not involve extra loading function can be overriden by this field in POST, correct?

@evshiron

Copy link
Copy Markdown
Contributor Author

I can confirm that show_progress_every_n_steps and show_progress_grid can be overrided.

You can find options in modules/shared.py and try to override something you need.

@aliencaocao

Copy link
Copy Markdown
Contributor

I see, thank you

@DenkingOfficial

Copy link
Copy Markdown
Contributor

Is it possible to get grid from api when batch size > 1?
Can't find this parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants