Detect Words · PixText:
PixTextAutoDetect, displayed as “Detect Words · PixText” in the PixText category, automatically locates words in an image and reads their text to help you prepare a text-editing workflow. It combines local CRAFT text detection, which identifies areas that look like written characters and groups them into word regions, with PP-OCRv6 recognition, which interprets the characters inside those regions. This reduces the effort of manually locating every word and gives you a starting point for selecting text to refine. Its visual annotations make it easier to inspect where text was found and compare the recognized wording with the original artwork. Detection is a suggestion stage rather than an automatic correction or image-generation step: the intended workflow is to run detection, review the suggestions in the PixText Region Editor, and apply the regions before refinement.
Detect Words · PixText Input Parameters:
image
A required COMBO selection for choosing an image file when you are not supplying a connected image. Its default is the bundled English example, represented in the source by ENGLISH_EXAMPLE; the supplied code does not reveal the exact dropdown label. Other options are image files found recursively in your ComfyUI input directory, listed by their relative paths and sorted alphabetically. Supported dropdown file extensions are .png, .jpg, .jpeg, and .webp, with case-insensitive extension matching, and the interface supports image upload. When loading from this selection, the node corrects orientation using the file’s EXIF information and converts the image to RGB before detection. If image_in is connected, that connected image takes priority and this selection is not used as the detection source. Minimum and maximum values do not apply.
text_threshold
A required FLOAT that controls the CRAFT detector’s threshold for identifying text-like areas. The default is 0.5, the minimum is 0.1, the maximum is 0.95, and the adjustment step is 0.05; this is marked as an advanced setting. In CRAFT detection, this threshold relates to text-region scores rather than the certainty that a recognized word is spelled correctly. Lowering it generally makes detection more permissive, which can help with faint or weakly defined lettering but can also admit background details that resemble text. Raising it makes detection more selective, which can reduce false detections but may miss less distinct words. Start with the default and adjust it while inspecting the preview, especially when your artwork contains textured backgrounds, low-contrast labels, or decorative lettering.
link_threshold
A required FLOAT that controls the threshold for the linking information used by CRAFT to associate nearby character areas. The default is 0.2, the minimum is 0.1, the maximum is 0.95, and the adjustment step is 0.05; this is also an advanced setting. CRAFT uses these links to help group characters into text regions, so changing this value can affect whether neighboring character areas are connected or remain separate. A lower value generally accepts weaker links and can help connect fragmented lettering, while a higher value rejects weaker links and may help separate regions that are being joined too readily. The precise result depends on the lettering and spacing in your image, so evaluate the detected boxes rather than assuming that one direction always produces better word boundaries. This is not a recognition-confidence threshold.
image_in
An optional IMAGE connection that supplies the image directly from another node in your workflow. When provided, it overrides the image dropdown completely, allowing you to detect text in an image produced or processed elsewhere without first choosing a saved file. The connected tensor is converted to the image representation used by the detection process, and that same source is used to create the returned image and annotated preview. This makes the connection useful for examining generated artwork or images after resizing and other preparation steps. No numeric minimum, maximum, or explicit default is defined; leaving it unconnected makes the node use the selected image instead.
Detect Words · PixText Output Parameters:
image
An IMAGE containing the source image used for detection, returned without the word annotations added by this node. For a dropdown-selected file, this is the RGB image after EXIF orientation correction; for a connected image, it is the source obtained from image_in. This output provides a convenient way to keep the actual detection source connected to subsequent workflow stages, rather than accidentally pairing detections with a different image. It is not a text-corrected or refined result, and it does not contain newly generated lettering.
detections
A PIXTEXT_DETECTIONS object containing the structured OCR suggestions returned by the detection process. The supplied code confirms that its regions entries include a bbox describing a detected region’s bounding box and text containing the recognized wording; related Region Editor code also uses a detection_id to associate reviewed regions with their detection run. This is workflow data rather than an image or a simple text string, and it is intended to support reviewing the proposed text regions in the PixText Region Editor. Treat its recognized words and locations as suggestions: incorrect spelling, missed text, or imperfect grouping should be checked before you apply regions for refinement. The supplied context does not establish every field or the exact bounding-box representation, so it should not be treated as a fully documented interchange format.
words_preview
An IMAGE showing the source with annotations derived from the detected bounding boxes and recognized text. It helps you inspect which words were found, whether their regions are positioned sensibly, and whether the recognized wording matches the artwork. The node also displays this annotated image as its interface preview, so you can assess the detection before proceeding. This is a diagnostic visualization, not a final edited image: annotations are added for review and should not be confused with changes to the underlying lettering. Use the separate image output when a later stage needs the source without these annotations.
Detect Words · PixText Usage Tips:
- Start with
text_thresholdat 0.5 andlink_thresholdat 0.2. Inspectwords_previewbefore changing either setting so you can identify whether the issue is missing text, unwanted detections, or incorrect grouping. - For faint lettering or missed words, try lowering
text_thresholdby one 0.05 step at a time. Check the whole preview after each change, because making detection more permissive may also identify decorative patterns or background textures as text. - If background details are being mistaken for words, try raising
text_thresholdgradually. Stop if genuine lettering starts disappearing; a stricter threshold is not automatically more accurate. - If characters appear split into separate regions, experiment with a slightly lower
link_threshold. If neighboring lettering is being joined incorrectly, try a slightly higher value. Inspect the resulting regions carefully because grouping depends on the image. - Change one threshold at a time. This makes it easier to understand which adjustment improved the result and avoids confusing a text-detection problem with a character-grouping problem.
- Use
image_into detect text directly in an upstream image. Remember that this connection takes priority over the dropdown, so changingimagewill not change the source whileimage_inremains connected. - Run detection, open the PixText Region Editor, review the suggestions, and apply the regions before refinement. If you rerun detection after changing the source or settings, review and apply the updated suggestions again.
- Keep the source image and detections together through the workflow. Avoid pairing detections with an image that has subsequently been cropped, resized, or replaced, because the proposed regions may no longer align.
- The OCR call uses the model directory
ComfyUI/models/pixtext_ocr. If model initialization fails, check the PixText installation instructions and console output rather than assuming that the separate refinement model loader supplies the OCR assets.
Detect Words · PixText Common Errors and Solutions:
FileNotFoundError when loading the selected image
- Explanation: This is a possible file-loading exception rather than a custom message defined by this node. A selected image may have been moved or deleted after the dropdown was populated, or the bundled example file may be missing.
- Solution: Select or upload an existing image, refresh the available selections if needed, or connect a valid image through
image_in. If the bundled example is missing, check that your PixText installation includes its example files.
PIL.UnidentifiedImageError when opening an image
- Explanation: This is a possible Pillow image-loading exception. A file can have a supported extension but still contain damaged data or content that is not a readable image.
- Solution: Open the file in an image editor and export it as a fresh PNG or JPEG, then upload and select that new file. Renaming an extension alone does not repair or convert the image.
PermissionError when accessing image or model files
- Explanation: This is a possible operating-system exception, not a custom PixText error. ComfyUI may lack permission to read the selected image or access files needed for OCR.
- Solution: Confirm that the account running ComfyUI can read the input image and access
ComfyUI/models/pixtext_ocr. Correct the relevant folder permissions or ask your system administrator to help.
OCR model initialization or loading failure
- Explanation: The node runs OCR using
ComfyUI/models/pixtext_ocr, but the supplied code does not show the model-loading implementation or its exact error messages. Missing, incomplete, incompatible, or inaccessible model assets can therefore require investigation using the actual console traceback. - Solution: Read the first relevant model-loading error in the ComfyUI console, verify the OCR setup against the PixText installation instructions, and repair the specific missing or invalid assets reported there. Avoid downloading arbitrary model files based only on the folder name.
ModuleNotFoundError or ImportError during execution
- Explanation: These are possible Python dependency errors rather than node-specific messages shown in the supplied code. The node depends on the PixText package and image-processing components, and its OCR implementation may require additional dependencies.
- Solution: Install the dependencies specified by PixText into the same Python environment that runs ComfyUI, then restart ComfyUI. Use the missing module named in the traceback to identify the installation problem.
Review OCR suggestions in the Region Editor and Apply regions before refinement.
- Explanation: This exact message comes from the related Region Editor workflow, not directly from AutoDetect. It appears when the currently applied region data does not match the supplied detection run, preventing refinement from proceeding with mismatched suggestions.
- Solution: Open the Region Editor, review the current detections, and apply the regions again before refining. Repeat this review-and-apply step after rerunning detection.
“[number] words detected. Open Region Editor, review targets and Apply regions.”
- Explanation: This is the Region Editor’s review prompt, with the detected region count inserted in place of
[number]. It indicates that OCR suggestions are available but have not yet been applied as editing targets; it is not an AutoDetect failure. - Solution: Open the Region Editor, check the proposed regions and text, make any needed adjustments, and select Apply regions before continuing to refinement.
No words appear, or the detected text is incorrect
- Explanation: This is a result-quality issue rather than an exception message. Detection may miss text-like areas, group them incorrectly, or recognize the characters incorrectly; the thresholds affect detection and grouping, not guaranteed spelling accuracy.
- Solution: Verify that the intended image is being processed, especially if
image_inis connected. Adjusttext_thresholdfor missed or unwanted detections andlink_thresholdfor grouping problems, then review and correct the suggestions in the Region Editor before applying them.
