ImgRouter
Consolidate multiple image capabilities such as bean bag, Gitee, ModelScope, HuggingFace, and Pollinations into a unified OpenAI-compatible interface and provide a visual operation and maintenance background.
##Functional characteristics - Unified OpenAI image interface: Provide '/v1/chat/completions','/v1/images/generations','/v1/images/edits','/v1/images/blend' and '/v1/models' to facilitate direct access to the existing OpenAI ecosystem. - Dual-mode routing: supports Relay (the client directly carries the channel Key) and Backend (the Key pool and global access key are centrally maintained within the platform). - Multi-channel aggregation: Built-in Doubao, Gitee Model Ark, ModelScope, HuggingFace, Pollinations and NewAPI routing capabilities, which can be switched in cascade according to model and task type. - Visual operation and maintenance: The management desk provides channel switches, Key pools, log streams, image galleries, prompt word optimizers and version checks, which are suitable for daily maintenance and regression troubleshooting. ###First use process 1. open the application 2. Enter `System Settings` and confirm the operating mode: - `Transit Mode`: Clients carry their own Provider Keys. - Backend Mode: ImgRouter manages the Key pool, and additionally sets the Global Access Key. 3. Under the Lazy Cat Micro Service, the 'Service Port' will be displayed as a fixed managed port, and the button text will read 'Lazy Cat Managed'; changing the port or self-restarting in the management desk is not supported here. 4. If you plan to use backend mode, first confirm in System Settings that backend mode is enabled; Global Access Key can be left blank, and no additional verification of Bearer will be required when left blank. 5. Enter 'Channel Settings' and check the three types of configurations of 'Cultural Generation Picture','Picture Editing', and 'Integrated Generation Picture' by task type to confirm that the target channel is enabled and the model is visible in the drop-down. 6. Enter Key Pool Management to add real-life API keys to the target channel. For example: - `ModelScope`: There must be at least one key with a status of `Enabled`. - `NewApi`: In addition to the Key, make sure that `URL` is bound to the entry; if `URL: Not Set 'is displayed in the interface, the model will usually not be available during runtime. 7. First use 'curl' to verify whether the target model can be read by '/v1/models', and then send a formal drawing request: ```bash curl -s "https://img-router. Your box name.heiyu.space/v1/models" ``` If you can see models such as 'Tongyi-MAI/Z-Image-Turbo','Qwen/Qwen-Image-Edit', and 'FLUX.1-dev' in the return, continue sending requests: ```bash curl -X POST "https://img-router. Your box name.heiyu.space/v1/images/generations" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <your global access key or channel Key>" \ -d '{ "model": "Tongyi-MAI/Z-Image-Turbo", "prompt": "A panda sitting on the stone steps of a bamboo forest, with a national style and ink painting style, morning fog, and rich details", "n": 1, "size": "1024x1024" }' ``` 8. After success, go back to Picture Gallery and confirm that you can see the newly generated picture entries; if the page still shows 'No pictures have been generated', check 'Dashboard-> Real-time Log' first. ###Daily usage 1. Check the Key usage, success rate and log flow of each channel in the dashboard to quickly determine whether it is an upstream flow restriction or a local configuration problem. 2. Adjust the default model, default size and routing weights for different task types in Channel Settings, and tune separately for 'Wensheng Map','Picture Editing', and 'Fusion Map'. 3. Multiple keys are maintained by channel in Key Pool Management. Invalid keys can be deactivated or deleted, and normal keys will automatically participate in scheduling based on routing weights. 4. Configure an additional OpenAI-compatible model in the Prompt Optimizer to pre-process translation, expansion or touch up before generating pictures; the real interface will display API Base URL, Model, API Key, Enable Translation Function, Enable Extension Function, and two System Tips. 5. Check the generation history of local persistence in the 'Picture Gallery'; if the generation is not successful, the gallery will directly display the 'pictures that have not been generated yet.'



