ComfyUI > Nodes > ComfyUI-Documents

ComfyUI Extension: ComfyUI-Documents

Repo Name

ComfyUI-Documents

Author
Indra's Mirror (Account age: 37 days)
Nodes
View all nodes(6)
Latest Updated
2024-07-11
Github Stars
0.03K

How to Install ComfyUI-Documents

Install this extension via the ComfyUI Manager by searching for ComfyUI-Documents
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-Documents in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

ComfyUI-Documents Description

ComfyUI-Documents is an extension for ComfyUI that enhances workflows by enabling advanced document processing. It supports loading, parsing, and converting various document types (PDF, TXT, DOC, DOCX), extracting text, and converting PDF pages to images, integrating seamlessly with ComfyUI projects.

ComfyUI-Documents Introduction

ComfyUI-Documents is a powerful extension for the ComfyUI application, designed to enhance your workflow with advanced document processing capabilities. This extension seamlessly integrates document handling, parsing, and conversion features directly into your ComfyUI projects. Whether you are working with PDFs, text files, or Microsoft Word documents, ComfyUI-Documents provides the tools you need to efficiently manage and process your documents. This extension is particularly useful for AI artists who need to extract and manipulate text and images from various document formats, making it easier to incorporate these elements into their creative projects.

How ComfyUI-Documents Works

ComfyUI-Documents works by adding custom nodes to your ComfyUI workflow, each designed to handle specific document processing tasks. Think of these nodes as building blocks that you can connect together to create a customized document processing pipeline. For example, you can use one node to load a document, another to convert PDF pages to images, and yet another to split text into manageable chunks. By connecting these nodes in different ways, you can create a workflow that meets your specific needs.

Imagine you have a PDF document with multiple pages, and you want to extract images from specific pages and then process those images further. You can use the "PDF to Image" node to convert the pages to images, the "PDF Page Splitter" node to select the pages you are interested in, and the "Image Selector" node to pick the specific images you want to work with. This modular approach makes it easy to customize your workflow and achieve the desired results.

ComfyUI-Documents Features

Document Loader Node

  • Description: Easily browse, select, and parse documents from your input directory.
  • Supported Formats: PDF, TXT, DOC, DOCX.
  • Capabilities: Extracts text content, images, and metadata from documents.
  • Usage:
  1. Add the "Document Loader" node to your ComfyUI workflow.
  2. Use the dropdown to select a document from your input directory, or use the "Choose file to upload" button to add a new document.
  3. Connect the output to other nodes in your workflow to process the extracted text, images, or metadata. Document Loader Node

PDF to Image Node

  • Description: Convert PDF pages into high-quality image tensors.
  • Features:
  • Flexible page range selection for partial document processing.
  • Adjustable DPI settings for output image quality control.
  • Usage:
  1. Add the "PDF to Image" node to your ComfyUI workflow.
  2. Select a PDF file using the dropdown or file upload button.
  3. Set the desired page range and DPI.
  4. The node will output image tensors that can be used with other ComfyUI image processing nodes. PDF to Image Node

PDF Page Splitter Node

  • Description: Select specific pages from a PDF document.
  • Features:
  • Choose individual pages or ranges of pages.
  • Output selected pages as separate image tensors.
  • Usage:
  1. Add the "PDF Page Splitter" node to your workflow.
  2. Select a PDF file using the dropdown.
  3. Enter the desired page numbers (e.g., "1,3,5" or "1-5,7,9-11").
  4. Set the DPI for the output images.
  5. The node will output the selected pages as separate image tensors. PDF Page Splitter Node

Image Selector Node

  • Description: Pick specific images from a batch of images.
  • Features:
  • Select one or multiple images by index.
  • Useful for further processing of specific pages from PDF conversions.
  • Usage:
  1. Connect the output of a PDF to Image or PDF Page Splitter node to the Image Selector node.
  2. Enter the indexes of the images you want to select (e.g., "0" for the first image, or "0,2,4" for the first, third, and fifth images).
  3. The node will output only the selected images for further processing.

Text Chunker Node

  • Description: Divide large text into manageable chunks.
  • Features:
  • Split text by character or word count.
  • Respect word boundaries for more natural text division.
  • Usage:
  1. Connect the output of a Document Loader or any text-producing node to the Text Chunker node.
  2. Set the desired chunk size and method (characters or words).
  3. Choose whether to respect word boundaries.
  4. The node will output chunked text and corresponding indices. Text Chunker Node

Chunk Router Node (Currently Not Working) (WIP)

  • Description: Select specific text chunks for further processing.
  • Features:
  • Route individual chunks to different parts of your workflow.
  • Useful for processing long documents in parts.
  • Usage:
  1. Connect the output of the Text Chunker node to the Chunk Router node.
  2. Select the index of the chunk you want to process.
  3. The node will output the selected chunk for further processing.

Troubleshooting ComfyUI-Documents

Common Issues and Solutions

  1. Node Not Appearing in Workflow:
  • Solution: Ensure that the extension is properly installed and that you have restarted ComfyUI after installation. Check the custom nodes directory to confirm that the ComfyUI-Documents folder is present.
  1. Document Not Loading:
  • Solution: Verify that the document format is supported (PDF, TXT, DOC, DOCX). Ensure that the file path is correct and that the file is not corrupted.
  1. PDF to Image Conversion Issues:
  • Solution: Check the page range and DPI settings. Ensure that the PDF file is not password-protected or encrypted.
  1. Text Chunker Not Splitting Text Correctly:
  • Solution: Adjust the chunk size and method settings. Ensure that the "Respect word boundaries" option is enabled if you want more natural text division.

Frequently Asked Questions (FAQs)

  • Q: Can I use ComfyUI-Documents with other ComfyUI nodes?
  • A: Yes, ComfyUI-Documents nodes are designed to integrate seamlessly with other ComfyUI nodes, allowing you to create complex workflows.
  • Q: What file formats are supported by ComfyUI-Documents?
  • A: ComfyUI-Documents supports PDF, TXT, DOC, and DOCX file formats.
  • Q: How can I contribute to the development of ComfyUI-Documents?
  • A: Contributions are welcome! Please feel free to submit a Pull Request on the ComfyUI-Documents GitHub repository.

Learn More about ComfyUI-Documents

For more information and updates, please visit the ComfyUI-Documents GitHub repository. You can also explore the following resources to learn more about the libraries used in this extension:

  • ComfyUI: The base project for ComfyUI-Documents.
  • PyMuPDF: A library for robust PDF processing capabilities.
  • python-docx: A library for handling Microsoft Word documents. These resources provide additional documentation, tutorials, and community support to help you get the most out of ComfyUI-Documents.

ComfyUI-Documents Related Nodes

RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.