[GH-ISSUE #14114] glm-ocr cannot process images > 2048x2048 or larger #71267

Closed
opened 2026-05-05 01:00:17 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @slepkaviba on GitHub (Feb 6, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14114

Originally assigned to: @jmorganca on GitHub.

What is the issue?

When Given an image with Prompt "OCR" works fine if size is < 1800ish.

Here two images used for test - small one works, larger not.

Small:

Image

Large:

Image

Relevant log output


OS

Linux

GPU

RTX 4060Ti

CPU

5950X

Ollama version

0.15.5

Originally created by @slepkaviba on GitHub (Feb 6, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14114 Originally assigned to: @jmorganca on GitHub. ### What is the issue? When Given an image with Prompt "OCR" works fine if size is < 1800ish. Here two images used for test - small one works, larger not. Small: <img width="925" height="1024" alt="Image" src="https://github.com/user-attachments/assets/f26c515e-41d4-4087-8f27-ba4b704b36ac" /> Large: <img width="1849" height="2048" alt="Image" src="https://github.com/user-attachments/assets/777d8b73-ee29-4f75-9282-9217df0dd850" /> ### Relevant log output ```shell ``` ### OS Linux ### GPU RTX 4060Ti ### CPU 5950X ### Ollama version 0.15.5
GiteaMirror added the bug label 2026-05-05 01:00:17 -05:00
Author
Owner

@letorbi commented on GitHub (Feb 6, 2026):

The problem does not seem to be the width or height of an image, but its total amount of pixels.

However, increasing the context size (https://github.com/zai-org/GLM-OCR/issues/32) works around the problem. I am using a context size of 10240 and have successfully extracted text from the example image from the GLM-OCR issue, which has 12 megapixels.

Here is the modelfile I am using:

# Modelfile generated by "ollama show"
FROM glm-ocr:latest

# Increase context size
PARAMETER num_ctx 10240

TEMPLATE {{ .Prompt }}
RENDERER glm-ocr
PARSER glm-ocr
PARAMETER temperature 0
<!-- gh-comment-id:3862232149 --> @letorbi commented on GitHub (Feb 6, 2026): The problem does not seem to be the width or height of an image, but its total amount of pixels. However, increasing the context size (https://github.com/zai-org/GLM-OCR/issues/32) works around the problem. I am using a context size of 10240 and have successfully extracted text from the example image from the GLM-OCR issue, which has 12 megapixels. Here is the modelfile I am using: ``` # Modelfile generated by "ollama show" FROM glm-ocr:latest # Increase context size PARAMETER num_ctx 10240 TEMPLATE {{ .Prompt }} RENDERER glm-ocr PARSER glm-ocr PARAMETER temperature 0 ```
Author
Owner

@rick-github commented on GitHub (Feb 18, 2026):

Confirm that increasing context lets glm-ocr handle larger images. I rendered a page of ipsum at 2500 dpi for an image size of 20671 x 29233 and glm-ocr with a context size of 8192 extracted the text accurately.

<!-- gh-comment-id:3921359876 --> @rick-github commented on GitHub (Feb 18, 2026): Confirm that increasing context lets glm-ocr handle larger images. I rendered a page of ipsum at 2500 dpi for an image size of 20671 x 29233 and glm-ocr with a context size of 8192 extracted the text accurately.
Author
Owner

@p-arndt commented on GitHub (Feb 26, 2026):

Somehow cant get it work even with bigger context size

<!-- gh-comment-id:3968905786 --> @p-arndt commented on GitHub (Feb 26, 2026): Somehow cant get it work even with bigger context size
Author
Owner

@rick-github commented on GitHub (Feb 26, 2026):

What version of ollama? 0.17.1 appears to have broken glm-ocr.

<!-- gh-comment-id:3968915772 --> @rick-github commented on GitHub (Feb 26, 2026): What version of ollama? 0.17.1 appears to have broken glm-ocr.
Author
Owner

@p-arndt commented on GitHub (Feb 26, 2026):

Ah okay that might explain it, i have ollama version is 0.17.1-rc1
Does version 0.17.0 work ? Version 0.17.0 works

<!-- gh-comment-id:3969076784 --> @p-arndt commented on GitHub (Feb 26, 2026): Ah okay that might explain it, i have `ollama version is 0.17.1-rc1` ~Does version 0.17.0 work ?~ Version 0.17.0 works
Author
Owner

@rick-github commented on GitHub (Feb 27, 2026):

Closing this for the size issue, the 0.17.1 breakage will be followed up in #14474.

<!-- gh-comment-id:3970111768 --> @rick-github commented on GitHub (Feb 27, 2026): Closing this for the size issue, the 0.17.1 breakage will be followed up in #14474.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71267