Skip to content

Add OpenAI-compatible image adapter#18

Open
henryzhou9527-ship-it wants to merge 1 commit into
RachelForster:mainfrom
henryzhou9527-ship-it:codex/openai-image-adapter
Open

Add OpenAI-compatible image adapter#18
henryzhou9527-ship-it wants to merge 1 commit into
RachelForster:mainfrom
henryzhou9527-ship-it:codex/openai-image-adapter

Conversation

@henryzhou9527-ship-it
Copy link
Copy Markdown

Summary

  • Add an OpenAIImageAdapter for OpenAI/NewAPI-compatible image generation endpoints.
  • Register openai-image and newapi-image in T2IAdapterFactory so existing Settings UI adapter selection and t2i_extra_configs can configure it.
  • Support base64 and URL image responses, prompt-based size selection, optional quality/moderation fields, and a conservative retry without optional fields on 400 responses.

This is the split-out PR B: OpenAI/NewAPI image adapter only requested in review on #12. It intentionally does not add runtime provider switching menus or provider_switcher YAML writers.

Test plan

  • python -m py_compile t2i/t2i_adapter.py t2i/t2i_manager.py test/unit/adapters/test_openai_image_adapter.py
  • python -m pytest test/unit/adapters/test_openai_image_adapter.py test/unit/managers/test_t2i_manager.py test/unit/test_schema.py -> 27 passed.

Comment thread t2i/t2i_manager.py
'stable diffusion': StableDiffusionAdapter,
'comfyui': ComfyUIT2IAdapter,
'openai-image': OpenAIImageAdapter,
'newapi-image': OpenAIImageAdapter,
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问为什么这个要重复两次?没有太明白

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.

2 participants