Skip to content

Image Generation

lqdflying edited this page Jul 25, 2026 · 45 revisions

Image Generation

ChatHub's Image workspace creates and manages AI-generated images at /image. It is available in server-mode deployments when the ai_image feature is enabled.

Open Image

  • On desktop, select Image in the left navigation.
  • On mobile, select the middle Image tab in the bottom navigation.

Discover remains available as a separate desktop action and direct route.

Create an image

  1. Open Image Settings and select an available provider and model.
  2. Adjust the supported model options and choose an image count from 1 to 50.
  3. Enter a non-empty prompt.
  4. Select Generate.

On desktop, settings stay in the left panel. On mobile, the sliders button in the header opens settings in a bottom drawer so the workspace remains usable on small screens.

For signed-in users, ChatHub remembers the selected provider, model, image count, and any supported Size option when the Image workspace is reopened on the same browser. If a saved model or Size option is no longer available, ChatHub uses an available model and its current defaults instead while retaining a valid saved image count. A prompt typed while settings are loading is preserved. If enabled providers, models, or supported options change while the app is open, ChatHub revalidates the active settings. A disabled model switches to an available usable model, and options that the updated model no longer supports reset to that model's current defaults. Models whose generation settings cannot be loaded are hidden from Image Settings and skipped when ChatHub chooses a fallback. If a provider has no usable image models, its model list shows guidance to review that provider in Settings.

If no usable image model is enabled, Image Settings shows the provider/model guidance instead of remaining in a loading state. Generation stays disabled until an image provider and usable model are enabled in Settings. If the previously remembered model later becomes usable, ChatHub restores it before choosing another enabled model.

The prompt is trimmed before submission. ChatHub shows an error message and unlocks the Generate control if topic creation or request submission fails.

Image topics

Each generation belongs to an Image Topic. Creating an image without an active topic creates one automatically.

  • Desktop shows topics in the right panel.
  • Mobile opens Image Topics from the list button in the header.

Use topics to switch between generation histories or start a new topic.

Manage results and reference images

Generation cards provide actions to download or delete an image, copy/apply a seed when supported, reuse settings, copy a prompt, or delete a batch. These controls are visible on touch devices and do not require hover.

Models that accept reference images expose add, change, upload-more, and delete controls in Image Settings. The same controls are keyboard accessible and remain visible on coarse-pointer devices.

Retry behavior

If a batch reports an invalid provider API key, correct the provider credentials and retry. ChatHub submits the replacement first and removes the failed batch only after the replacement is accepted. If submission fails, the original batch remains available. The topic is refreshed after every retry attempt.

Troubleshooting

Symptom Action
Image is missing from navigation Confirm the deployment is running in server mode and the ai_image feature is enabled.
Generate is disabled Enter a prompt containing at least one non-whitespace character and confirm an image provider/model is enabled.
Generation could not start Reopen Image Settings and verify the provider, model, credentials, and supported parameters.
Invalid API key Update that provider's API key, then retry the failed batch.
Reference image cannot upload Verify the file type/size and object-storage configuration, then retry.
Results do not update immediately Reopen the Image Topic or refresh the page; retry always requests a batch refresh.
Unexpected token '<' or HTML response in server logs Enable CHATHUB_IMAGE_DEBUG=1, recreate the container, submit one image, and check for chathub-image-debug dispatch/response events.

For production-safe server diagnostics, use CHATHUB_IMAGE_DEBUG=1 as described in Debug and Diagnostics. Response diagnostics sample the normal internal JSON read without cloning the response stream, and internal correlation headers are accepted only with the server bearer credential. Provider identifiers appear only as keyed hashes, and each async request has one terminal async_route_settled outcome. Avoid DEBUG=lobe-image:* in privacy-sensitive environments because legacy namespaces can expose prompts or URLs.

Clone this wiki locally