Skip to content

Add BigModel GLM-Image generation for canvas and Agent - #251

Open
unicorn1125 wants to merge 2 commits into
ThinkFlowLab:mainfrom
unicorn1125:codex/glm-image-237-implementation
Open

unicorn1125 wants to merge 2 commits into
ThinkFlowLab:mainfrom
unicorn1125:codex/glm-image-237-implementation

Conversation

@unicorn1125

@unicorn1125 unicorn1125 commented Nov 10, 2026 •

Copy link
Copy Markdown

Summary

Adds GLM-Image text-to-image generation through a BigModel connection, available from both the canvas and Agent commands. Includes the provider preset, supported sizes, and Chinese and English setup guides.

The adapter uses BigModel's synchronous image endpoint, validates downloaded image bytes, and saves results as project assets and candidates. Credentials stay off CDN requests. Download recovery reuses the saved result URL, and uncertain submissions are never automatically reposted.

Linked issue

Labels

  • Maintainer access needed to apply type:feat, area:provider, area:canvas, area:agent, and modality:image.

Test plan

After rebasing onto current main (e0b411f):

  • .venv/bin/python -m pytest tests -q: 1,384 passed, 6 skipped, including all 38 GLM-Image cases with mocked HTTP and real image bytes.
  • node --test tests/*.test.ts: 699 passed.
  • Build, bilingual checks, import contracts, generated contracts, and dependency checks passed.
  • Installation and local startup passed during the original feature acceptance. The watermark review follow-up below adds two live calls after the original acceptance.
  • Left to CI: maintainer-triggered Release checks. Linux, Windows, other browser engines, and conversational Agent orchestration remain unverified.

The detailed record is in docs/development/glm-image-validation.md.

Evidence that it works

  • Screenshots attached.

Canvas result adopted into the project:

Canvas adopted result

Canvas output:

Canvas output preview

Reopened Agent project, showing the model and prompt:

Reopened Agent project

Agent output:

Agent output preview

Provider verification

  • Real-provider calls described below.

Tested with a real BigModel account: a 1280×1280 canvas image and a 960×1728 image through AgentTools. Both were adopted and verified after reopening their projects. The Agent check covers business tools, not conversational model orchestration. The original acceptance submitted three requests: two succeeded and one timed out with unknown acceptance. Two further requests verified the watermark setting off and on, bringing the total to five. Billing for the timed-out request was not verified.

Bilingual UI

  • Both zh-CN and en-US are included for the preset, errors, and setup documentation.

Review follow-up

OpenAI compatible is first in the image provider dropdown again, with a regression check for its position. A Chinese/English note appears above Generate when BigModel is selected and Remove watermark is on, explaining the signed-waiver requirement and its location in the BigModel account settings.

Tested the same prompt at 1280×1280 with Remove watermark off and on. The actual request sent watermark_enabled=true and false respectively, matching the saved execution settings. Both returned images still contained a visible mark. This reproduces the reported behavior despite the correct request mapping. BigModel documents that disabling watermarks requires a signed waiver; the account's waiver status and removal for a signed account remain unverified. Provider output is preserved.

Follow-up validation: 80 selected Python tests and 700 frontend tests passed, along with the production build, i18n and generated-contract checks. Browser checks covered both languages, the note appearing/disappearing when the setting changes, and provider order.

English waiver note

Chinese waiver note

Provider order

Real outputs with Remove watermark off and on

@unicorn1125
unicorn1125 force-pushed the codex/glm-image-237-implementation branch from e45823b to 5d9b9d2 Compare November 10, 2026 01:13

@FayeSpica FayeSpica left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding GLM-Image support, and please check whether it respects the “Remove watermark” setting.


export const PROVIDER_PRESETS: ProviderPreset[] = [
{
id: "bigmodel",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please keep OpenAI compatible first in the image provider dropdown.

if spec.kind == 'image' and input_rules(config)['profile'] == 'moss-image':
params.update(prompt_enhance=False, watermark=not self.settings.get()['removeWatermark'])
if spec.kind == 'image' and input_rules(config)['profile'] == 'bigmodel-glm-image':
params = dict(size=params['size'], watermark_enabled=not self.settings.get()['removeWatermark'])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The generated GLM-Image output did not follow the Remove watermark setting in local testing. Please verify the output with the setting on and off.

@FayeSpica FayeSpica added type:feat New capability or behaviour area:provider Model providers and generation protocols area:canvas Canvas, nodes and direct manipulation area:agent Agent runtime, assistant chat and tools modality:image Image generation or editing labels Nov 10, 2026
@FayeSpica

Copy link
Copy Markdown
Collaborator

please fix conflicts

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

Labels

area:agent Agent runtime, assistant chat and tools area:canvas Canvas, nodes and direct manipulation area:provider Model providers and generation protocols modality:image Image generation or editing type:feat New capability or behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] providers: add Zhipu BigModel GLM-Image generation

2 participants