External models (Gemini Nano Banana & OpenAI GPT Image) (#8633)#8884
External models (Gemini Nano Banana & OpenAI GPT Image) (#8633)#8884CypherNaught-0x wants to merge 13 commits intoinvoke-ai:mainfrom
Conversation
|
I did some testing. Works fine (only did gemini) A few comments
|
Some Changes that should be done:In from invokeai.app.api.dependencies import ApiDependencies
record = ApiDependencies.invoker.services.model_manager.store.get_model(request.model.key)No other service in the codebase imports from In MODEL_SOURCE_TO_TYPE_MAP = {
...
ExternalModelSource: ModelSourceType.Url,
}
In for config in (runtime_config, file_config):
config.update_config(updates)
for field_name, value in updates.items():
if value is None:
config.model_fields_set.discard(field_name)This directly mutates the In In I think to save the API keys in the invoke.yaml is not the best choice here. This is something that the development team in https://discord.com/channels/1020123559063990373/1049495067846524939 should discuss. |
|
@CypherNaught-0x Please see the changes requested from @Pfannkuchensack above. |
|
Thanks @Pfannkuchensack for the valuable feedback! I didn't feel comfortable disabling all the inputs as I didn't see this done elsewhere but you are right of course in that it makes no sense to show for example CFG when that property is not used. This was more of a first draft since I wasn't sure how such a large addition would be received so I haven't yet spent much time polishing things like the install queue. I was positively surprised with the feedback so I'll try and get things to a more polished state for the next review round. How are the discussions on the API Key storage coming along? I saw that the model marketplace can store API keys there as well so figured with a decently restricted API key this might be ok though I'd obviously also prefer at least non-plain-text storage. |
|
Pfannkuchensack@3c83692 i did some work on the hiding of unneeded things in the ui. Maybe take a Look Or copy the whole Thing from there. |
|
The API keys require a separate YAML file. This is better because it allows the API key to be kept separate. |
We need a unified place to stash user's security tokens and API keys. I just now proposed a "Token Manager" in Issue #8904 . Temporarily, you could add @Pfannkuchensack Does this seem like a reasonable interim solution to API key storage or would it be better to have a completely separate API keys file, like |
|
I would prefer the separate file, especially since there will be another solution later, thus avoiding major changes to the invoke.yaml file. |
|
@CypherNaught-0x I'm wondering what you see as the timetable for this? I'm thinking we'll be ready for a 6.12 release in the second week of March. Would that be targetable, or later? The release after that will likely be mid April. |
I had already started work on this and your implementation looks very similar so I'll try and integrate them. Also very much looking forward to |
|
@lstein I've had some time to work on it. I'll try and get things into a polished state and push the changes. I believe mid march should be very much reasonable for a release target. |
7671304 to
3620541
Compare
Summary
This PR adds support for external model provider APIs with Google and OpenAI added for now.
It supports txt2img, img2img and image references.
I tried to make it fit well within the application and be easily extensible for future models.
Related Issues / Discussions
#8633 includes functionality requested here
QA Instructions
Select an external provider in the model setup dialog and add an API key.
Select a new model from the dropdown list.
...
Profit
Checklist
What's Newcopy (if doing a release after this PR)