A Smart Image Processing System and Method for Website Group Articles Based on ComfyUI Workflow Engine
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-08-14
AI Technical Summary
这种割裂式处理方式造成系统级协同能力不足,无法有效量化不同处理节点间的依赖关系与资源消耗,亦难以在批量处理场景下实现显存与算力的动态优化
本发明通过对站点历史用图数据与实时图像内容进行协同建模,实现了图像质量优化、风格一致性控制与语义匹配约束的统一编排,使色调偏好、构图留白、分辨率规范及合规规则等多维特征能够被量化表达与综合评估,显著提升了站群图像处理结果在视觉一致性与内容匹配度方面的准确性与稳定性,为规模化内容生产与精细化运营提供了可靠的技术支撑。
Smart Images

Figure CN122574155A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to an intelligent image processing system and method for website group articles based on the ComfyUI workflow engine. Background Technology
[0002] Existing image processing methods for content production in website clusters face multi-dimensional technical bottlenecks in terms of scalability and consistency control. In particular, traditional static image editing strategies struggle to balance processing quality and system efficiency when dealing with multi-site style constraints and semantic consistency. As website cluster systems simultaneously serve multiple sites and cover different sections and content types, each site exhibits significant differences in color preferences, composition habits, resolution standards, and compliance rules. A single fixed process or manual configuration for each site cannot meet dynamically changing publishing needs.
[0003] In practical applications, when image enhancement effects (such as sharpness improvement or color saturation enhancement) are prioritized, their potential impact on site style consistency and compliance constraints is often overlooked. Simultaneously, multimodal semantic information is not fully utilized, leading to semantic deviations between image processing results and article content. To ensure basic processing efficiency, existing solutions typically execute image quality optimization, style adaptation, and compliance filtering in isolation, lacking a unified workflow orchestration and collaborative control mechanism. This fragmented processing approach results in insufficient system-level collaboration capabilities, an inability to effectively quantify the dependencies and resource consumption between different processing nodes, and difficulty in dynamically optimizing memory and computing power in batch processing scenarios. Ultimately, while individual processing metrics may meet targets, overall publishing quality, semantic matching accuracy, and cross-site consistency are difficult to guarantee, lacking systematic support for large-scale intelligent content production.
[0004] In view of this, the present invention proposes an intelligent image processing system and method for website group articles based on the ComfyUI workflow engine to solve the above problems. Summary of the Invention
[0005] To overcome the aforementioned deficiencies of the prior art and to achieve the above objectives, the present invention provides the following technical solution: A method for intelligent image processing of articles in a website group based on the ComfyUI workflow engine includes: By connecting to the website group article editor, the system receives the original images and website group article context information submitted by users, and performs format processing and quality benchmark evaluation on the received original images to obtain standard image data packages. Obtain the identifiers, historical article image records, and site delivery rules of each site within the current site group management architecture to construct site style profiles; combine standard image data packages and site group text context information to select and combine workflow nodes from the preset node template library, and construct workflow instances based on them; The standard images in the standardized image data package are combined with the contextual information of the articles in the website group and input into the preset multimodal understanding model. A semantic guidance map is generated based on the model output and injected into the workflow instance as a region-aware constraint. Export the injected workflow instance as a callable RESTful API and optimize the inference parameters to adapt to batch processing scenarios. By receiving batch image processing requests forwarded via the RESTful API interface, breaking them down into independent processing tasks and writing them into the request queue, and dynamically scheduling idle ComfyUI workflow engine instances based on the containerized deployment architecture to pull the tasks to be processed from the request queue, driving the corresponding workflow engine instance to execute the injected workflow instance, and obtaining the processed image; The processed images are assigned a unified resource identifier according to the site group category, content type, and version number, stored in the media resource library, and a CDN access link with access control is generated.
[0006] Furthermore, the process of building a site style profile includes: Color space statistical analysis was performed on historical images in the historical article's image record to obtain a frequency distribution histogram. By estimating the kernel density of the peak interval of the frequency distribution histogram, the hue preference weight vector of each site was obtained. Extract the minimum bounding rectangle corresponding to the main object in each historical image, and use the ratio of the bounding rectangle to the total area of the image as the white space ratio. Then, generate the white space preference distribution interval through quantile statistics. Frequency statistics are performed on the resolution field in the graph records of historical articles, and a target resolution set is constructed based on the frequency statistics results; Visual feature clustering is performed on the violation image samples in the site delivery rules. The texture feature descriptors of each cluster center are extracted and stored as prohibited element rules along with the corresponding violation category labels. The proportion of images that triggered the watermark removal operation in the image records of each historical article was statistically analyzed and mapped to the (0,1) interval to generate watermark sensitivity parameters; The color tone preference weight vector, composition white space preference distribution range, target resolution set, disabled element rules and watermark sensitivity parameters are structured and encapsulated to generate a site style profile.
[0007] Furthermore, the process of building a workflow instance includes: Lightweight image analysis is performed on the standard images within the standard image data package, and the required and optional workflow nodes are extracted from the preset node template library in combination with the disabled element rules in the site style profile. For the extracted workflow nodes, an applicability score is calculated. The extracted workflow nodes are serialized into graph nodes according to the Directed Acyclic Graph (DAG) representation specification of the ComfyUI workflow engine to obtain an initial DAG. The DAG is then topologically sorted to obtain a DAG. Inject the dynamic parameters of the current task into the hyperparameter slots of each workflow node in the directed acyclic graph to obtain a workflow instance, and then serialize and store the workflow instance in JSON format. Generate a node parameter contract table based on the data dependencies between adjacent workflow nodes in the directed acyclic graph.
[0008] Furthermore, the applicability score is obtained by weighted fusion of the matching degree between the node function of the workflow node and the image requirements, the conformity of the node output to the site style profile constraints, and the normalized cost of the node's estimated GPU memory usage.
[0009] Furthermore, the workflow nodes include a watermark removal node, a super-resolution magnification node, an intelligent image expansion node, a background cutout node, a local smear removal node, and an image clarity enhancement node.
[0010] Furthermore, the process of generating a semantic guidance graph includes: The standard image and the context information of the articles in the website group are jointly input into the pre-constructed multimodal understanding model. The multi-scale spatial structure feature map corresponding to the standard image is extracted, and then bilinear interpolation is used to upsample it to a uniform resolution. After channel dimension concatenation, a spatial structure feature tensor is generated. At the same time, the context information of the articles in the website group is encoded into a text semantic vector, and it is aligned with the spatial structure feature tensor across modalities to generate a spatial attention weight map. Based on the spatial attention weight map, the foreground semantic region is segmented in the standard image, and the outer contour of the foreground semantic region is morphologically dilated to generate an editable region boundary. Obtain the region mask of the foreground semantic region, and overlay it with the editable region boundary and spatial attention weight map to generate a semantic guidance map; For each workflow node in the workflow instance, the corresponding channel of the semantic guidance graph is injected into the region-aware constraint parameter slot of each workflow node according to the node parameter contract table.
[0011] Furthermore, the process of optimizing inference parameters to adapt to batch processing scenarios includes: The standard image data packets in the current batch image processing request are grouped by resolution. Annotated images with the same resolution or belonging to the same target resolution set are grouped into the same processing batch to obtain a resolution grouping batch table. Static estimation of the video memory usage of each workflow node in the workflow instance corresponding to each processing batch is performed to determine the maximum inference batch size of each workflow node, and the minimum value of the maximum inference batch size of each workflow node is taken as the global batch size upper limit of the current batch. Based on the global batch size limit and resolution grouping batch table, the standard images in each processing batch are further segmented according to the global batch size limit to generate inference sub-batch sequences; The image tensors within each sub-batch in the inference sub-batch sequence are stacked according to the channel dimension to generate a batch input tensor; the inference precision of each workflow node is simultaneously set to half-precision floating-point format. Write the global batch size limit, inference sub-batch sequence, batch input tensor construction method, and inference precision settings into the batch processing extended field of the node parameter contract table.
[0012] Furthermore, the process of obtaining the processed image includes: Receive batch image processing requests forwarded via RESTful API and verify the validity and completeness of the requests; once the verification is passed, generate independent processing tasks by decomposing the standard image data packets of the batch image processing requests. The independent processing tasks are prioritized to obtain a comprehensive priority score; and the independent processing tasks are written into the distributed request queue in descending order according to the comprehensive priority score. A ComfyUI workflow engine instance pool is built based on a containerized deployment architecture, and each workflow engine instance in the ComfyUI workflow engine instance pool periodically reports its current availability, current load, and GPU resource utilization to the task scheduling center. When an available workflow engine instance in an idle state is detected, the task to be processed at the head of the request queue is retrieved and assigned to the target idle instance via an RPC call; After receiving the task to be processed, the target workflow engine instance loads the JSON file of the corresponding workflow instance, parses the node topology and parameter settings in the workflow instance, and injects the standard image data package and semantic guidance graph as input data into the workflow starting node. The workflow engine executes each workflow node sequentially according to the topological order of the directed acyclic graph, and synchronizes the task execution progress with the task scheduling center after execution is completed. Once the workflow engine instance has completed the execution of all nodes, it extracts the processed image from the output node, writes it to a temporary output buffer, sends a task completion signal to the scheduling center, releases the GPU memory occupied by the task, and updates its own status to idle.
[0013] Furthermore, the process of generating a unified resource identifier, storing it in the media resource library, and generating a CDN access link with access control includes: Extract the processed image and its associated task metadata, which includes the original task identifier, target site identifier, column affiliation field and content type in the context information of the site group article; A resource path hierarchy is constructed based on site identifier, column affiliation field, and content type, and logical storage paths are generated by using a directory tree organization method; version management is performed on multiple processing results of the same original image to obtain version serial numbers; The site identifier, column affiliation, content type, version number, and image hash value are concatenated according to the preset URI specification to generate a resource URI that conforms to the Uniform Resource Identifier format. The processed image files, along with their resource URIs, task metadata, processing workflow configuration snapshots, and quality benchmark evaluation results, are written into a pre-built media resource library; and the image permission attributes are configured according to the target site's access control policy, and the permission attributes are written into the access control list field of the resource metadata. It also synchronously calls the API interface of the CDN service provider to register the image file paths in the media resource library to the CDN edge node, and configures the CDN access authentication rules according to the permission attributes, including timestamp anti-hotlinking, IP whitelist and token signature verification. The CDN service returns an accelerated and optimized access link, attaches access control parameters to the access link, generates a CDN access link with access control, and writes the link into the task result data packet and returns it to the site group article editor.
[0014] A website group article intelligent image processing system based on the ComfyUI workflow engine, comprising: The image preprocessing interface module is used to receive the original image and the context information of the article in the website group submitted by the user, and to perform image preprocessing on the received original image to obtain a standard image data packet. The site style profile module is used to obtain the identifiers, historical article image records, and site delivery rules of each site within the current site group management architecture to construct site style profiles. The workflow planning module is used to select and combine workflow nodes from the preset node template library based on the standard images in the standard image data package, the context information of the articles in the site group, and the site style profile, and to build workflow instances based on them; The semantic guidance module is used to input the standard images in the standardized image data package and the context information of the articles in the website group into the preset multimodal understanding model to generate a semantic guidance map, and inject it as a region-aware constraint into the workflow instance. The batch inference encapsulation module is used to export the injected workflow instance as a callable RESTful API and optimize inference parameters to adapt to batch processing scenarios. The resource management module receives batch image processing requests forwarded via the RESTful API interface, breaks them down into independent processing tasks and writes them into the request queue. Based on the containerized deployment architecture, it dynamically schedules idle ComfyUI workflow engine instances to pull tasks to be processed from the request queue, drives the corresponding workflow engine instance to execute the injected workflow instance, and obtains the processed image. The media asset integration module is used to generate a unified resource identifier for the processed images according to the site group column, content type and version number, store them in the media resource library and generate CDN access links with access control.
[0015] The technical effects and advantages of the intelligent image processing system and method for website group articles based on the ComfyUI workflow engine of this invention are as follows: This invention achieves unified arrangement of image quality optimization, style consistency control, and semantic matching constraints by collaboratively modeling historical image data and real-time image content of a site. This enables multi-dimensional features such as color preference, compositional white space, resolution standards, and compliance rules to be quantitatively expressed and comprehensively evaluated, significantly improving the accuracy and stability of the site cluster image processing results in terms of visual consistency and content matching, and providing reliable technical support for large-scale content production and refined operation.
[0016] In practical applications, even when faced with different site styles and various article types, this method can still achieve adaptive adjustment of image enhancement intensity, region editing range and output specifications based on multimodal semantic understanding and dynamic parameter injection mechanism. It no longer relies on fixed processing templates or repeated manual adjustments, avoiding problems such as the disconnect between image processing and article semantics and inconsistent styles across sites, making the overall publishing effect more coordinated and efficient.
[0017] In particular, the closed-loop control mechanism for the construction of site style profiles and the cross-node injection of semantic guidance graphs breaks through the limitations of isolated operation of each processing module in the traditional process, the inability to quantify the constraint relationship and resource consumption between nodes, effectively reduces resource waste and style deviation risk in batch processing, improves system throughput and result reproducibility, and enhances the stability and controllability of image processing in large-scale deployment environments. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of an intelligent image processing method for website group articles based on the ComfyUI workflow engine according to the present invention; Figure 2 This is a schematic diagram of an intelligent image processing system for website group articles based on the ComfyUI workflow engine, according to the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] Example 1 Please see Figure 1 As shown in the embodiment of this application, a method for intelligent image processing of articles in a website group based on the ComfyUI workflow engine includes: Step S1: Receive the original images and context information of the articles submitted by the user through the interface website group article editor, and perform format processing and quality benchmark evaluation on the received original images to obtain standard image data packets.
[0021] The original image refers to an image file uploaded by a user through the website group article editor that has not yet undergone standardization processing. Its format may include various types such as JPEG and PNG, and there may be differences in resolution and color space. The website group article context information refers to the article content information associated with the original image, including descriptive fields such as article title, body text, category, target site identifier, and content type, which are used to provide semantic reference for subsequent image processing. Format processing refers to operations such as size verification, color space conversion, format conversion, and metadata cleaning of the original image to eliminate format inconsistencies caused by differences in image sources. Quality benchmark assessment refers to obtaining benchmark assessment results that reflect the intensity of image processing requirements by quantitatively analyzing quality indicators such as sharpness, noise level, color saturation, and resolution of the original image. The standard image data package refers to a structured encapsulation set of standard images after format processing, quality benchmark assessment results, and image metadata, which serves as a unified input carrier for subsequent processing modules.
[0022] In one embodiment, the original image and corresponding context information of the website group article are received in real time through the upload interface of the website group article editor; the original image undergoes a unified color space conversion (e.g., conversion to sRGB color space) and encoding format normalization, and redundant fields in the image metadata are removed; subsequently, the image sharpness is calculated based on the Laplacian operator, and the original image is evaluated based on indicators such as signal-to-noise ratio and resolution to obtain a quality benchmark evaluation result containing scores for each quality dimension; finally, the standard image, the quality benchmark evaluation result, and the image metadata are structurally encapsulated to generate a standard image data package; the calculation process of image sharpness and the acquisition process of signal-to-noise ratio are existing technologies and will not be elaborated on in this application.
[0023] Step S2: Obtain the identifiers, historical article image records, and site delivery rules of each site within the current site group management architecture to construct a site style profile; combine standard image data packages and site group text context information to select and combine workflow nodes from the preset node template library, and construct workflow instances based on them.
[0024] Among them, the site identifier refers to the unique code of each independent site within the site group management architecture, used to distinguish different sites and associate their corresponding historical data and configuration rules; the historical article image record refers to the complete archive of images used in historically published articles by each site, including image files, resolution fields, triggered image processing operation types, and other information; the site delivery rules refer to the restrictive configurations of each site regarding the use of image content, including prohibited image content types, violating image samples, and corresponding violation category tags; and the site style profile refers to a comprehensive analysis of each site's color preferences, composition habits, size specifications, content taboos, and watermark sensitivity. The site image style description model is formed by the structured encapsulation of multiple attributes; the preset node template library refers to a standardized set of pre-configured templates containing various image processing function nodes. Each node corresponds to a specific image processing function, including watermark removal nodes, super-resolution magnification nodes, intelligent image expansion nodes, background cutout nodes, local smear removal nodes, and image clarity enhancement nodes; the workflow instance refers to the directed acyclic graph representation specification based on the ComfyUI workflow engine. After organizing the selected workflow nodes according to data dependencies and injecting dynamic parameters, it is serialized into an executable workflow configuration file in JSON format.
[0025] In an embodiment of the present invention, the process of constructing a site style profile includes: Color space statistical analysis was performed on historical images within the historical article image record, extracting frequency distribution histograms of hue channels. Kernel density estimation was then performed on the peak intervals of the frequency distribution histograms to obtain the dominant hue intervals and hue preference weight vectors for each site. The color space statistical analysis process first involved converting the historical images from the RGB color space to the HSV color space. Frequency statistics were then performed on the hue channels in the HSV color space according to a pre-defined hue interval granularity, forming a frequency distribution histogram covering the entire hue range. Kernel density estimation was performed by smoothly fitting the peak intervals of the frequency distribution histogram using a Gaussian kernel function to obtain a continuous hue probability density function. In the formula, This indicates an estimated hue value. Indicates the first Tone observations from historical images; The total number of historical image samples; For bandwidth, This represents the Gaussian kernel function; maxima detection is performed on the curve corresponding to the hue probability density function, extracting local maxima points where the density value exceeds a preset significance threshold. Each maxima point is used as the center, extending outwards to the boundaries of intervals where the density value drops below a preset proportion of the maxima, thus determining the hue clustering intervals corresponding to each local maxima point. The top N (N is an integer) hue clustering intervals with the highest density values are then sorted in descending order of density value and taken as the main hue intervals for that site. The kernel density estimates of each main hue interval are normalized to form a hue preference weight vector. This hue preference weight vector can quantitatively describe the site's preference distribution pattern in image color style, providing site-level constraints for hue correction operations in subsequent workflow node parameter configurations.
[0026] The process involves salient object detection on historical images, extracting the minimum bounding rectangle corresponding to the main object in each historical image, and using the ratio of this minimum bounding rectangle to the total image area as the whitespace ratio. Quantile statistics are then performed on the whitespace ratio of historical images for each site to generate a distribution interval for compositional whitespace preferences. The salient object detection process uses visual saliency detection technology to segment the main region of each historical image, extracting the pixel-level mask of the main object, and calculating the area of the minimum bounding rectangle based on the mask boundary. The whitespace ratio is defined as the ratio of the total image area minus the area of the minimum bounding rectangle to the total image area, reflecting the degree of utilization of whitespace space in the image composition. The 25th, 50th, and 75th quantiles of the whitespace ratio sequence of historical images for each site are used to determine the quantile intervals as the distribution intervals for compositional whitespace preferences. This reflects the numerical range of whitespace habits in the compositional style of that site and provides constraints on site compositional style for subsequent parameter configuration.
[0027] Frequency statistics are performed on the resolution field of historical article image records. After sorting by frequency in descending order, the set of resolution values whose cumulative frequency percentage exceeds a preset coverage threshold is retained as the target resolution set. The frequency statistics process involves traversing the historical article image records of each site, extracting the width and height fields of the image in each historical article image record, using the width and height combination as the resolution key value for frequency accumulation, and then, after sorting by frequency in descending order, accumulating the frequency percentage starting from the highest frequency resolution until the cumulative frequency percentage exceeds the preset coverage threshold. Then, a target resolution set is formed based on all the resolution values included in the statistics. The target resolution set reflects the mainstream resolution distribution of historical image usage at the site, providing a basis for subsequent target resolution parameter configuration, and also constraining the output size specifications after image processing.
[0028] Visual feature clustering is performed on the violation image samples in the site's delivery rules. Texture feature descriptors for each cluster center are extracted and stored as prohibited element rules along with their corresponding violation category labels. The visual feature clustering process extracts Local Binary Pattern (LBP) texture features or deep feature representations based on pre-trained convolutional neural networks from the violation image samples. Then, the K-means clustering algorithm is used to divide the violation samples into several visually semantically similar violation categories. For each cluster center corresponding to each violation category, its texture feature descriptor is calculated. The texture feature descriptor is a fixed-length vectorized representation of the texture distribution pattern in a local area of the image, obtained by statistically analyzing the gray-level change patterns in the neighborhood of image pixels. It can compactly encode the texture structure features of the violation visual elements. The texture feature descriptors and their corresponding violation category labels are encapsulated as prohibited element rules in key-value pairs. The prohibited element rules are used to filter nodes that may generate violation visual elements during the workflow node selection process.
[0029] The proportion of images triggering watermark removal operations in the image records of each historical article is statistically analyzed and mapped to the (0, 1) interval to generate watermark sensitivity parameters. The statistical process involves traversing the image records of historical articles on each site, calculating the ratio of the number of images containing watermark removal operation markers to the total number of images to obtain the original watermark sensitivity ratio. Then, based on the Sigmoid function, the original watermark sensitivity ratio is mapped to the (0, 1) interval to obtain the watermark sensitivity parameters, making the mapping results smoothly distributed and facilitating subsequent weighted fusion.
[0030] The site style profile is generated by structurally encapsulating the color preference weight vector, composition white space preference distribution range, target resolution set, disabled element rules, and watermark sensitivity parameters. The structural encapsulation adopts a JSON key-value pair organization method, with the site identifier as the primary key and the above five types of profile elements as subfields, forming the site style profile data structure. The site style profile is persistently stored in the site configuration database, supports fast retrieval by site identifier, and triggers an incremental update mechanism when the site's historical article image records are updated to maintain the timeliness of the profile.
[0031] In this embodiment of the invention, the detailed implementation steps for constructing workflow instances include: Lightweight image analysis is performed on standard images within standard image data packets to extract content categories. Combined with prohibited element rules from the site style profile, mandatory and optional workflow nodes are extracted from a pre-defined node template library. Lightweight image analysis uses a lightweight classification model (such as MobileNetV3) to identify content categories in the standard images. The identification results include several predefined content categories such as people, landscapes, products, and text / graphics. Mandatory workflow nodes are those that must be included in the workflow to ensure basic processing quality, given the current image content category and prohibited element rules. For example, when the quality benchmark assessment shows that the image sharpness index is less than a preset sharpness threshold, the image sharpness enhancement node is marked as mandatory. Optional workflow nodes are those that can be selectively included in the workflow as needed, based on the specific requirements of the current task and site style profile constraints. Prohibited element rules are used to filter nodes that may produce non-compliant outputs, ensuring the compliance of workflow instances.
[0032] Calculate the applicability score for the extracted workflow nodes; based on the applicability score and in accordance with the Directed Acyclic Graph (DAG) representation specification of the ComfyUI workflow engine, serialize the extracted workflow nodes into graph nodes to obtain an initial DAG; and perform topological sorting on the initial DAG to obtain a final DAG. The suitability score is a numerical indicator used to quantify the adaptability of each node to the current task. It is obtained by weighting and fusing the matching degree between the node function and image requirements, the conformity of the node output to the site style profile constraints, and the normalized cost of the node's estimated GPU memory usage. The matching degree between the node function and image requirements is calculated based on the semantic similarity between the content category and the node function description. The conformity of the node output to the site style profile constraints is evaluated based on the color preference weight vector and the distribution range of composition white space preference. The normalized cost of the node's estimated GPU memory usage is calculated by querying the memory usage benchmark value in the node template library and comparing it with the currently available GPU memory. The three scores are weighted and fused according to preset weight coefficients to obtain the comprehensive suitability score. Optional workflow nodes with suitability scores lower than the preset screening threshold are eliminated. The topological sorting of the directed acyclic graph adopts the Kahn algorithm to ensure that each node is arranged in the correct execution order according to the data dependency relationship and to eliminate circular dependency anomalies.
[0033] Dynamic parameters of the current task are injected into the hyperparameter slots of each workflow node in the directed acyclic graph (DAG) to obtain a workflow instance, which is then serialized and stored in JSON format. Dynamic parameters refer to node hyperparameters that change dynamically according to the current task requirements, including magnification, expansion direction and margin ratio, and coordinates of the smear removal area. The hyperparameter slot injection process calculates the magnification of the super-resolution magnification node based on the quality benchmark evaluation results in the standard image data package and the target resolution set in the site style profile; calculates the expansion direction and margin ratio of the intelligent expansion node based on the composition white space preference distribution range; and determines the coordinates of the smear removal area by parsing the pre-detection results based on the input specifications of the local smear removal node. The JSON serialization and storage unifies the node list, edge connections, node hyperparameter configurations, and dynamic parameter injection results of the DAG into the ComfyUI standard workflow JSON format, persistently storing it in the workflow instance database, supporting on-demand loading during subsequent RESTful API calls.
[0034] Based on the data dependencies between adjacent workflow nodes in the directed acyclic graph, a node parameter contract table is generated. The node parameter contract table is a structured specification document that describes the input and output data format, type, and dimension constraints between adjacent workflow nodes in the directed acyclic graph. It is used to ensure the compatibility of data transmission between nodes and simultaneously serves as the parameter routing basis for subsequent semantic guidance graph injection and inference parameter optimization processes, ensuring that various constraint information can be accurately written into the correct parameter slots of the target node.
[0035] Step S3: Input the standard image in the standard image data package and the context information of the articles in the website group into the preset multimodal understanding model, generate a semantic guidance map based on the model output, and inject the semantic guidance map as a region-aware constraint into the workflow instance.
[0036] Among them, the multimodal understanding model refers to a task-adaptive Kontext multimodal understanding model that can simultaneously accept images and text as input. The task-adaptive configuration includes: fine-tuning the parameters or adapting the domain of the pre-trained Kontext multimodal model using standard images and contextual information of website group articles to enhance its ability to extract semantic associations from website group article images and make its output suitable for generating semantic guidance maps. The semantic guidance map refers to a multi-channel image generated by the multimodal understanding model through joint analysis of standard images and contextual information of website group articles, which includes foreground semantic region masks, editable region boundaries and spatial attention weights, and is used to provide spatially aware constraints for each workflow node during workflow instance execution. Region-aware constraints refer to spatial constraint information that uses the corresponding channel data of the semantic guidance map as a carrier and injects it into the region-aware constraint parameter slots of each workflow node to limit the processing range and intensity distribution of the nodes.
[0037] In this embodiment of the invention, the detailed implementation steps for generating a semantic guidance graph include: The standard image and the contextual information of the articles from various websites are jointly input into a pre-constructed multimodal understanding model. The input process first performs normalization preprocessing on the standard image, scaling the pixel values to the input range required by the model. Then, the text of the articles in the contextual information of the website group is segmented and truncated to ensure that the length of the input sequence meets the maximum context length limit of the model.
[0038] The visual encoder within the multimodal understanding model extracts multi-scale spatial structure feature maps corresponding to the standard image, and then performs bilinear interpolation upsampling to a uniform resolution before channel-dimensional concatenation to generate a spatial structure feature tensor. By extracting multi-scale spatial structure feature maps containing both high-level semantic information and low-level detail information from different network layers based on the visual encoder, bilinear interpolation upsampling uniformly scales the feature maps to a resolution equal to the size of the standard image, and channel-dimensional concatenation concatenates the multi-scale feature maps along the channel axis to form a spatial structure feature tensor. This spatial structure feature tensor simultaneously preserves both high-level semantic information and low-level spatial details of the image, providing rich visual feature representations for subsequent cross-modal alignment operations.
[0039] A text encoder within a multimodal understanding model synchronously encodes the contextual information of articles from various websites into text semantic vectors. These vectors are then cross-modally aligned with a spatial structure feature tensor to generate a spatial attention weight map. The text encoder performs sequence modeling on the segmented article text, extracting a global semantic representation to obtain text semantic vectors. Cross-modal alignment calculates the attention score between the text semantic vectors and the feature vectors at each spatial location within the spatial structure feature tensor, and then normalizes this score using Softmax to obtain a spatial attention weight map covering all spatial locations of the image. Regions with higher weight values in the spatial attention weight map indicate a stronger correlation between the image content at that spatial location and the semantics of the article text, guiding subsequent nodes to focus on processing semantically relevant regions.
[0040] Foreground semantic region segmentation is performed on standard images based on spatial attention weight maps, and morphological dilation is applied to the outer contour of the foreground semantic regions to generate editable region boundaries. The foreground semantic region segmentation process first uses the spatial attention weight map as a segmentation prior. A thresholding operation is used to mark spatial locations with weight values higher than a preset segmentation threshold as foreground semantic regions, generating a binary foreground semantic region mask. The morphological dilation operation uses preset rectangular structuring elements to expand the outer contour of the foreground semantic regions, extending the boundary outward by several pixels to generate editable region boundaries. These editable region boundaries are used in the intelligent image expansion node and the local smear removal node to define the area where content generation operations can be safely performed, preventing processing operations from exceeding the boundaries and damaging the core subject area.
[0041] The region mask of the foreground semantic region is obtained and then overlaid with the editable region boundary and the spatial attention weight map via a channel overlay to generate a semantic guidance map. The region mask is a binary mask generated during the foreground semantic region segmentation process and is stored as a single-channel image. The channel overlay operation generates a three-channel semantic guidance map by stitching the region mask, the single-channel representation of the editable region boundary, and the spatial attention weight map along the channel axis. The three channels of the semantic guidance map respectively carry foreground region constraints, boundary constraints, and semantic weight information, and each channel corresponds to the region-aware constraint requirements of different workflow nodes.
[0042] For each workflow node in the workflow instance, the corresponding channels of the semantic guidance graph are injected into the region-aware constraint parameter slots of each workflow node according to the node parameter contract table. The injection process involves injecting the first channel (region mask) of the semantic guidance graph into the mask input slots of the background cutout node and the local smear removal node, the second channel (editable region boundary) into the boundary constraint slot of the intelligent map expansion node, and the third channel (spatial attention weight map) into the region weighting processing slot of the image sharpness enhancement node. After injection, each workflow node will perform differentiated processing on different spatial regions according to the injected region-aware constraints during execution, ensuring that the processing results are semantically consistent with the article content.
[0043] Step S4: Export the injected workflow instance as a callable RESTful API and optimize the inference parameters to adapt to batch processing scenarios.
[0044] Among them, RESTfulAPI refers to a standardized interface designed in accordance with the REST architectural style and using the HTTP protocol as the transmission carrier. It is used to expose the calling capabilities of workflow instances to the outside world and support external systems to trigger image processing tasks through standardized requests. Inference parameters refer to configuration items that affect the execution efficiency and resource consumption of workflow instances, including inference batch size, inference precision format and cache reuse strategy, etc. Their reasonable settings are the key to supporting the system throughput and stability in batch processing scenarios.
[0045] In this embodiment of the invention, the detailed implementation steps for optimizing inference parameters to adapt to batch processing scenarios include: The standard image data packets in the current batch image processing request are grouped by resolution. Standard images with the same resolution or belonging to the same target resolution set are grouped into the same processing batch, and the number of images in each group is counted to generate a resolution grouping batch table. The resolution grouping process involves traversing all standard image data packets in the batch image processing request, extracting the resolution field from each standard image data packet, and comparing it with the target resolution set in the site style profile to determine the resolution set to which each standard image belongs. Standard images with the same resolution or belonging to the same set are merged into the same processing batch so that images in the same batch can be processed in parallel in a single inference call, reducing the padding overhead caused by resolution inconsistencies. The resolution grouping batch table uses the batch identifier as the primary key and records the resolution set, number of images, and image identifier list corresponding to each batch.
[0046] Static estimation of GPU memory usage for each workflow node within the workflow instance corresponding to each processing batch is performed to determine the maximum inference batch size for each workflow node. The minimum of the maximum inference batch sizes for each workflow node is then used as the global batch size upper limit for the current batch. The static estimation process for GPU memory usage involves querying the pre-stored baseline values for GPU memory usage in the node template library based on the type, input resolution, and model parameter scale of each workflow node. These baseline values are then scaled in conjunction with the resolution level of the current processing batch to obtain the estimated GPU memory usage for each workflow node in the current batch. The scaling process uses the ratio of the total number of pixels at the current resolution to the total number of pixels at the baseline resolution as the scaling degree. The maximum inference batch size is calculated by dividing the total available GPU memory by the estimated GPU memory usage per image at that node, reflecting the maximum number of images that can be processed in parallel during a single inference run without exceeding the GPU memory capacity limit. The minimum of the maximum inference batch sizes for each workflow node is used as the global batch size upper limit to ensure that no GPU memory overflow occurs during execution of any node in the workflow instance.
[0047] Based on the global batch size limit and the resolution grouping batch table, the standard images within each processing batch are further sliced according to the global batch size limit to generate an inference sub-batch sequence. The secondary slicing process involves equally dividing the image list of each processing batch in the resolution grouping batch table according to the global batch size limit. When the number of images in a processing batch does not exceed the global batch size limit, it is directly treated as a single inference sub-batch. When the number of images exceeds the global batch size limit, the image list is sequentially divided into several inference sub-batches according to the global batch size limit, with the last inference sub-batch containing the remaining images. The inference sub-batch sequence is grouped and arranged according to resolution levels to ensure consistent resolution between adjacent sub-batches and reduce GPU context switching overhead.
[0048] For the image tensors within each sub-batch in the inference sub-batch sequence, they are stacked according to the channel dimension to generate a batch input tensor; simultaneously, the inference precision of each workflow node is set to half-precision floating-point format. The image tensor stacking process involves preprocessing each standard image within the same inference sub-batch, uniformly scaling it to the standard size of the current resolution level, and then stacking it along the batch dimension to generate a batch input tensor with the shape (batch size, number of channels, height, width); the half-precision floating-point format reduces the numerical precision of model weights and intermediate activation values from 32-bit floating-point to 16-bit floating-point, reducing memory usage while maintaining inference quality.
[0049] The global batch size limit, inference sub-batch sequence, batch input tensor construction method, and inference precision settings are written into the batch processing extension field of the node parameter contract table to complete the inference parameter optimization. The batch processing extension field is an extended data area of the node parameter contract table in batch processing scenarios. It stores the above inference parameter optimization results in a structured manner, so that subsequent workflow engine instances can read and apply the corresponding batch processing configuration when loading workflow instances, ensuring that each workflow node can perform efficient inference according to the optimized parameter settings during execution.
[0050] Step S5: By receiving batch image processing requests forwarded via RESTful API, breaking them down into independent processing tasks and writing them into the request queue, and dynamically scheduling idle ComfyUI workflow engine instances based on the containerized deployment architecture to pull the tasks to be processed from the request queue, driving the corresponding workflow engine instance to execute the injected workflow instance, and obtaining the processed image.
[0051] Among them, the independent processing task refers to breaking down each standard image data packet in the batch image processing request into an independent processing task that can be scheduled and executed independently, and each independent processing task corresponds to a complete processing flow of a standard image data packet; the request queue refers to a distributed task queue sorted by priority, used to temporarily store independent processing tasks to be processed, and supports concurrent retrieval by multiple ComfyUI workflow engine instances; the containerized deployment architecture refers to encapsulating ComfyUI workflow engine instances into mutually isolated and elastically scalable container services based on container technology, supporting the dynamic creation and recycling of workflow engine instances to adapt to load changes; the ComfyUI workflow engine instance pool refers to a collection of multiple ComfyUI workflow engine instances managed by the containerized deployment architecture, and each instance periodically reports its availability status, current load, and GPU resource utilization to the task scheduling center.
[0052] In this embodiment of the invention, the detailed implementation steps for obtaining the processed image include: The system receives batch image processing requests forwarded via a RESTful API and verifies the validity and completeness of these requests. The validity verification process involves checking the authentication information, interface signature, and request format of the received batch image processing requests to ensure the request source is trustworthy and the format complies with RESTful API specifications. The completeness verification process checks the standard image data packet fields in the request body to verify the completeness of the site identifier, category affiliation field, content type tag, and required fields for standard image files. It also verifies the format compliance and file size of the standard image files. Requests that fail verification return the corresponding error status code and error description information; requests that pass verification proceed to the task decomposition process.
[0053] Once verification is passed, independent processing tasks are generated by decomposing the standard image data packets of the batch image processing request. The task decomposition process involves traversing all standard image data packets in the batch image processing request and encapsulating the complete processing flow of a single standard image data packet into a smallest, independently schedulable execution unit with a unique task identifier. Each independent processing task record includes fields such as a standard image data packet reference, target site identifier, corresponding workflow instance identifier, and task creation timestamp. Independent processing tasks are encapsulated at a fine-grained task level to ensure that the failure of a single task does not affect the execution of other tasks, and supports independent retries for failed tasks.
[0054] Independent processing tasks are prioritized to obtain a comprehensive priority score. Based on this comprehensive priority score, the independent processing tasks are then written into the distributed request queue in descending order. The priority calculation comprehensively considers three factors: task creation time (earlier creation prioritizes higher priority), image resolution (lower resolution prioritizes higher priority to improve overall throughput), and priority tags in the site's delivery rules. These factors are weighted and combined according to preset weights to obtain the comprehensive priority score. The distributed request queue adopts a priority queue structure, supporting dynamic sorting based on the comprehensive priority score to ensure that high-priority tasks are processed first. The queue uses a persistent storage mechanism to ensure that tasks are not lost after a system restart.
[0055] The task scheduling center is a central scheduling service component responsible for monitoring the status of each workflow engine instance, receiving instance heartbeat reports, and making task allocation decisions based on instance availability. Current availability status refers to the working status of a workflow engine instance at the current moment, including idle, running, and abnormal states. RPC calls refer to the communication method by which the task scheduling center sends task allocation instructions to target idle instances via the Remote Procedure Call protocol, offering lower call latency compared to HTTP polling.
[0056] A ComfyUI workflow engine instance pool is built based on a containerized deployment architecture. Each workflow engine instance in the pool periodically reports its current availability, current load, and GPU resource utilization to the task scheduling center. The containerized deployment architecture allocates an independent Docker container environment to each ComfyUI workflow engine instance. The container pre-installs the ComfyUI runtime environment and the model weight files that all workflow nodes depend on. Each workflow engine instance sends a heartbeat report to the task scheduling center at fixed time intervals. The report includes the instance identifier, availability status (idle or busy), number of tasks currently being processed, and GPU memory utilization. The task scheduling center maintains a status view of the instance pool based on the heartbeat reports, supporting instance failure detection and automatic removal.
[0057] When an idle workflow engine instance is detected, the task at the head of the request queue is retrieved and assigned to the target idle instance via RPC call. The task scheduling center triggers the task assignment process upon receiving an instance heartbeat report and detecting that the instance is idle. It retrieves the task with the highest overall priority score from the head of the distributed request queue and transmits the task identifier, workflow instance identifier, and standard image data packet to the target idle instance via Remote Procedure Call (RPC). The RPC call uses an asynchronous, non-blocking method, allowing the task scheduling center to immediately continue processing the next scheduling event without waiting for the target instance's processing result, thus improving scheduling throughput.
[0058] After receiving the task to be processed, the target workflow engine instance loads the JSON file of the corresponding workflow instance, parses the node topology and parameter settings in the workflow instance, and injects the standard image data package and semantic guidance graph as input data into the workflow starting node. During the loading process, based on the workflow instance identifier carried in the task, the corresponding JSON serialized file is read from the workflow instance database, and the node list, edge connections, and hyperparameter configurations in the file are parsed. The directed acyclic graph structure is reconstructed internally by the engine. The standard image file in the standard image data package is decoded into an image tensor, and then processed along with the semantic guidance graph. Figure 1 The starting node of the directed acyclic graph is injected as initial input data to prepare for the workflow execution.
[0059] The workflow engine executes each workflow node sequentially according to the topological order of the directed acyclic graph, and synchronizes the task execution progress to the task scheduling center after each workflow node completes execution. The workflow engine determines the node execution order based on the topology sorting result. For the starting node without a predecessor node, execution begins immediately. For the successor node with a predecessor node, execution begins after all its predecessor nodes have completed execution and output results. After each workflow node completes execution, it writes the output data to the data buffer between nodes for subsequent nodes to read. At the same time, it sends a node completion notification to the task scheduling center, which includes the task identifier, the identifier of the completed node, and the current overall task completion percentage. The task scheduling center updates the task progress view accordingly.
[0060] Once the workflow engine instance has completed the execution of all nodes, it extracts the processed image from the output node, writes it to a temporary output buffer, sends a task completion signal to the scheduling center, and simultaneously releases the GPU memory occupied by the task and updates its own status to idle. The output node is a terminal node in a directed acyclic graph with no successor nodes; its output data is the final processing result. The processed image is decoded from the output tensor of the output node into a standard image file format, written to a local temporary output buffer, and the file path is recorded. The task completion signal carries the task identifier and the temporary output file path; upon receiving the signal, the task scheduling center marks the task as completed. The GPU memory release operation clears the model activation cache and intermediate feature tensors used during this task execution, restores the instance's GPU memory to idle levels, and completes resource reclamation.
[0061] Step S6: Generate a unified resource identifier for the processed images according to the site group category, content type, and version number, store them in the media resource library, and generate a CDN access link with access control.
[0062] Among them, the Uniform Resource Identifier (URI) refers to a standardized identifier that can uniquely locate the corresponding image resource in the media resource library by concatenating the site identifier, column affiliation, content type, version number, and image hash value according to the preset URI specification; the media resource library refers to a structured storage system used for persistent storage of processed image files and their associated metadata, supporting retrieval and management according to the resource path hierarchy; and the CDN access link with access control refers to an image access link that has been accelerated and optimized by the CDN service provider and has been equipped with access control parameters such as timestamp anti-leeching, IP whitelist, and token signature verification, which is used to prevent unauthorized access while ensuring access speed.
[0063] In this embodiment of the invention, the detailed implementation steps for generating a unified resource identifier, storing it in a media resource library, and generating a CDN access link with access control include: The processed image and its associated task metadata are extracted. This task metadata includes the original task identifier, target site identifier, and the category affiliation and content type fields from the context information of the website group articles. The task metadata extraction process reads the complete metadata of currently completed tasks from the task completion records in the task scheduling center. This includes the original task identifier, target site identifier, category affiliation field, and content type field, which are generated and written into the independent processing task record during the task decomposition process. These fields will serve as the core input parameters for subsequent resource path hierarchy construction and unified resource identifier generation.
[0064] A resource path hierarchy is constructed based on site identifier, category affiliation field, and content type, and a logical storage path is generated using a directory tree organization method. Version management is implemented for multiple processing results of the same original image, resulting in a version number. The resource path hierarchy uses site identifier as the root directory, category affiliation field as the second-level directory, and content type as the third-level directory, forming a three-level directory tree logical storage path. During version management, the number of historical processing records associated with the current original task identifier is queried in the media resource library. The number of historical records is incremented by one to obtain the current version number. If the current original task identifier has no historical records, the version number is initialized to 1. The version number ensures that multiple processing results of the same original image are stored independently in the media resource library and can be traced by version.
[0065] The site identifier, category affiliation, content type, version number, and image hash value are concatenated according to a preset URI specification to generate a resource URI conforming to the Uniform Resource Identifier (URI) format. The image hash value is calculated using the SHA-256 algorithm on the processed image file content, ensuring that the resource URI uniquely identifies an image file with specific content. The URI concatenation connects the fields sequentially according to a preset format, separating fields with forward slashes or hyphens, forming a clear and highly readable URI. The uniqueness of the resource URI is guaranteed by the image hash value; even images of the same type generated at different times within the same site and category will have different resource URIs.
[0066] The processed image files, along with their resource URIs, task metadata, processing workflow configuration snapshots, and quality benchmark assessment results, are written into a pre-built media resource library. The image permission attributes are configured according to the target site's access control policy, and these attributes are written into the access control list field of the resource metadata. The media resource library uses an object storage architecture, with the resource URI as the object key and the image file as the object value. The resource URI, task metadata, processing workflow configuration snapshot, and quality benchmark assessment results are stored as metadata. The processing workflow configuration snapshot records the JSON content of the workflow instance used to generate the current processing result and the inference parameter settings, supporting subsequent reproducibility and traceability. The access control policy is read from the site's deployment rules, including constraints such as the scope of allowed user roles, access time limits, and regional access restrictions. These constraints are encoded into a structured access control list field and written into the resource metadata.
[0067] Simultaneously, the system calls the CDN service provider's API to register the image file paths from the media resource library to the CDN edge nodes. It also configures CDN access authentication rules based on permission attributes, including timestamp-based anti-leeching, IP whitelisting, and token signature verification. The CDN registration process submits the image file paths to the CDN system by calling the CDN service provider's content push API, triggering the CDN to preload the corresponding image files from the media resource library into the edge node cache, reducing access latency for end users. Timestamp-based anti-leeching is implemented by attaching a validity period timestamp parameter to the access link and signing the parameter with a key; expired access links will be rejected by the CDN edge nodes. The IP whitelist is generated based on the geographical access restrictions in the access control list field, allowing only IP addresses within the whitelist to access the corresponding image resources. Token signature verification requires the accessing party to include an authorization token signed by the server's key in the request; the CDN edge nodes verify the token before returning the image content.
[0068] The CDN service returns an accelerated and optimized access link, appends access control parameters to this link to generate an access-controlled CDN access link, and writes this link into the task result data packet returned to the website group article editor. The access control parameters include the expiration time parameter for timestamp anti-leeching, the IP whitelist verification identifier, and the token field for token signature verification. These parameters are concatenated to the end of the access link returned by the CDN according to the CDN service provider's URL parameter specifications. The task result data packet is encapsulated in JSON format, containing the original task identifier, the resource URI of the processed image, the access-controlled CDN access link, and a quality benchmark assessment result summary field. The task result data packet is returned to the requesting website group article editor via the RESTful API response body. After parsing, the editor inserts the access-controlled CDN access link into the article image reference field, completing the end-to-end processing and delivery process of the image resources.
[0069] One embodiment of the present invention further includes: During the execution of the workflow implementation, a real-time monitoring unit is deployed in the task scheduling center to periodically collect the GPU memory usage, task execution status, and queue backlog of each workflow engine instance in the ComfyUI workflow engine instance pool. The queue backlog refers to the total number of independent atomic processing tasks in the distributed request queue that are pending processing, reflecting the balance between the overall system's task processing capacity and task arrival rate. When the queue backlog exceeds a preset backlog threshold, the difference between the queue backlog and the preset backlog threshold is calculated and divided by the average processing rate of a single workflow engine instance to obtain the theoretical expansion quantity. This theoretical expansion quantity is then multiplied by a preset expansion coefficient and rounded up to obtain the actual expansion quantity. A container creation request is then sent to the container orchestration platform to start the specified number of new container instances. The new container instances complete the ComfyUI process. After initialization, the runtime environment registers with the task scheduling center and joins the instance pool to participate in task scheduling. Simultaneously, the idle duration of each workflow engine instance is statistically analyzed. Idle duration refers to the continuous idle time span from the last time a workflow engine instance completes a task and updates its available state to idle to the current moment. When the idle duration of a workflow engine instance exceeds a preset idle duration threshold and the total number of currently idle instances is greater than a preset minimum instance count, a shutdown notification is sent to the instances to be recycled. Upon receiving a shutdown confirmation signal, a container deletion request is initiated to the container orchestration platform to release the GPU and memory resources occupied by the containers. Through elastic scaling and instance recycling mechanisms, the size of the ComfyUI workflow engine instance pool adaptively adjusts between the minimum and maximum instance count limits based on the real-time task load.
[0070] Example 2 Please see Figure 2 As shown, parts not described in detail in this embodiment are described in Embodiment 1. A website group article intelligent image processing system based on the ComfyUI workflow engine is provided, including: The image preprocessing interface module is used to receive the original image and the context information of the article in the website group submitted by the user, and to perform image preprocessing on the received original image to obtain a standard image data packet. The site style profile module is used to obtain the identifiers, historical article image records, and site delivery rules of each site within the current site group management architecture to construct site style profiles. The workflow planning module is used to select and combine workflow nodes from the preset node template library based on the standard images in the standard image data package, the context information of the articles in the site group, and the site style profile, and to build workflow instances based on them; The semantic guidance module is used to input the standard images in the standardized image data package and the context information of the articles in the website group into the preset multimodal understanding model to generate a semantic guidance map, and inject it as a region-aware constraint into the workflow instance. The batch inference encapsulation module is used to export the injected workflow instance as a callable RESTful API and optimize inference parameters to adapt to batch processing scenarios. The resource management module receives batch image processing requests forwarded via the RESTful API interface, breaks them down into independent processing tasks and writes them into the request queue. Based on the containerized deployment architecture, it dynamically schedules idle ComfyUI workflow engine instances to pull tasks to be processed from the request queue, drives the corresponding workflow engine instance to execute the injected workflow instance, and obtains the processed image. The media asset integration module is used to generate a unified resource identifier for the processed images according to the site group column, content type and version number, store them in the media resource library and generate CDN access links with access control.
[0071] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0072] All formulas in this manual are dimensionless and calculated numerically. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters and thresholds in the formulas are set by those skilled in the art according to the actual situation.
[0073] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for intelligent image processing of articles from website groups based on the ComfyUI workflow engine, characterized in that, include: By connecting to the website group article editor, the system receives the original images and website group article context information submitted by users, and performs format processing and quality benchmark evaluation on the received original images to obtain standard image data packages. Obtain the identifiers, historical article image records, and site delivery rules of each site within the current site group management architecture to construct site style profiles; combine standard image data packages and site group text context information to select and combine workflow nodes from the preset node template library, and construct workflow instances based on them; The standard images in the standardized image data package are combined with the contextual information of the articles in the website group and input into the preset multimodal understanding model. A semantic guidance map is generated based on the model output and injected into the workflow instance as a region-aware constraint. Export the injected workflow instance as a callable RESTful API and optimize the inference parameters to adapt to batch processing scenarios. By receiving batch image processing requests forwarded via the RESTful API interface, breaking them down into independent processing tasks and writing them into the request queue, and dynamically scheduling idle ComfyUI workflow engine instances based on the containerized deployment architecture to pull the tasks to be processed from the request queue, driving the corresponding workflow engine instance to execute the injected workflow instance, and obtaining the processed image; The processed images are assigned a unified resource identifier according to the site group category, content type, and version number, stored in the media resource library, and a CDN access link with access control is generated.
2. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 1, characterized in that, The process of building a site style profile includes: Color space statistical analysis was performed on the historical images in the historical articles to obtain a frequency distribution histogram. By estimating the kernel density of the peak interval of the frequency distribution histogram, the hue preference weight vector of each site was obtained. Extract the minimum bounding rectangle corresponding to the main object in each historical image, and use the ratio of the bounding rectangle to the total area of the image as the white space ratio. Then, generate the white space preference distribution interval through quantile statistics. Frequency statistics are performed on the resolution field in the graph records of historical articles, and a target resolution set is constructed based on the frequency statistics results; Visual feature clustering is performed on the violation image samples in the site delivery rules. The texture feature descriptors of each cluster center are extracted and stored as prohibited element rules along with the corresponding violation category labels. The proportion of images that triggered the watermark removal operation in the image records of each historical article was statistically analyzed and mapped to the (0,1) interval to generate watermark sensitivity parameters; The color tone preference weight vector, composition white space preference distribution range, target resolution set, disabled element rules and watermark sensitivity parameters are structured and encapsulated to generate a site style profile.
3. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 1, characterized in that, The process of building a workflow instance includes: Lightweight image analysis is performed on the standard images within the standard image data package, and the required and optional workflow nodes are extracted from the preset node template library in combination with the disabled element rules in the site style profile. For the extracted workflow nodes, an applicability score is calculated. The extracted workflow nodes are serialized into graph nodes according to the Directed Acyclic Graph (DAG) representation specification of the ComfyUI workflow engine to obtain an initial DAG. The DAG is then topologically sorted to obtain a DAG. Inject the dynamic parameters of the current task into the hyperparameter slots of each workflow node in the directed acyclic graph to obtain a workflow instance, and then serialize and store the workflow instance in JSON format. Generate a node parameter contract table based on the data dependencies between adjacent workflow nodes in the directed acyclic graph.
4. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 3, characterized in that, The suitability score is obtained by weighted fusion of the matching degree between the node function of the workflow node and the image requirements, the conformity of the node output to the site style profile constraints, and the normalized cost of the node's estimated GPU memory usage.
5. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 3, characterized in that, The workflow nodes include a watermark removal node, a super-resolution magnification node, an intelligent image expansion node, a background cutout node, a local smear removal node, and an image clarity enhancement node.
6. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 1, characterized in that, The process of generating a semantic guidance graph includes: The standard image and the context information of the articles in the website group are jointly input into the pre-constructed multimodal understanding model. The multi-scale spatial structure feature map corresponding to the standard image is extracted, and then bilinear interpolation is used to upsample it to a uniform resolution. After channel dimension concatenation, a spatial structure feature tensor is generated. At the same time, the context information of the articles in the website group is encoded into a text semantic vector, and it is aligned with the spatial structure feature tensor across modalities to generate a spatial attention weight map. Based on the spatial attention weight map, the foreground semantic region is segmented in the standard image, and the outer contour of the foreground semantic region is morphologically dilated to generate an editable region boundary. Obtain the region mask of the foreground semantic region, and overlay it with the editable region boundary and spatial attention weight map to generate a semantic guidance map; For each workflow node in the workflow instance, the corresponding channel of the semantic guidance graph is injected into the region-aware constraint parameter slot of each workflow node according to the node parameter contract table.
7. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 1, characterized in that, The process of optimizing inference parameters to suit batch processing scenarios includes: The standard image data packets in the current batch image processing request are grouped by resolution. Annotated images with the same resolution or belonging to the same target resolution set are grouped into the same processing batch to obtain a resolution grouping batch table. Static estimation of the video memory usage of each workflow node in the workflow instance corresponding to each processing batch is performed to determine the maximum inference batch size of each workflow node, and the minimum value of the maximum inference batch size of each workflow node is taken as the global batch size upper limit of the current batch. Based on the global batch size limit and resolution grouping batch table, the standard images in each processing batch are further segmented according to the global batch size limit to generate inference sub-batch sequences; The image tensors within each sub-batch in the inference sub-batch sequence are stacked according to the channel dimension to generate a batch input tensor; the inference precision of each workflow node is simultaneously set to half-precision floating-point format. Write the global batch size limit, inference sub-batch sequence, batch input tensor construction method, and inference precision settings into the batch processing extended field of the node parameter contract table.
8. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 1, characterized in that, The process of obtaining the processed image includes: Receive batch image processing requests forwarded via RESTful API and verify the validity and completeness of the requests; once the verification is passed, generate independent processing tasks by decomposing the standard image data packets of the batch image processing requests. The independent processing tasks are prioritized to obtain a comprehensive priority score; and the independent processing tasks are written into the distributed request queue in descending order according to the comprehensive priority score. A ComfyUI workflow engine instance pool is built based on a containerized deployment architecture, and each workflow engine instance in the ComfyUI workflow engine instance pool periodically reports its current availability, current load, and GPU resource utilization to the task scheduling center. When an available workflow engine instance in an idle state is detected, the task to be processed at the head of the request queue is retrieved and assigned to the target idle instance via an RPC call; After receiving the task to be processed, the target workflow engine instance loads the JSON file of the corresponding workflow instance, parses the node topology and parameter settings in the workflow instance, and injects the standard image data package and semantic guidance graph as input data into the workflow starting node. The workflow engine executes each workflow node sequentially according to the topological order of the directed acyclic graph, and synchronizes the task execution progress with the task scheduling center after execution is completed. Once the workflow engine instance has completed the execution of all nodes, it extracts the processed image from the output node, writes it to a temporary output buffer, sends a task completion signal to the scheduling center, releases the GPU memory occupied by the task, and updates its own status to idle.
9. The intelligent image processing method for website group articles based on the ComfyUI workflow engine according to claim 1, characterized in that, The process of generating a unified resource identifier, storing it in the media resource library, and generating a CDN access link with access control includes: Extract the processed image and its associated task metadata, which includes the original task identifier, target site identifier, column affiliation field and content type in the context information of the site group article; A resource path hierarchy is constructed based on site identifier, column affiliation field, and content type, and logical storage paths are generated by using a directory tree organization method; version management is performed on multiple processing results of the same original image to obtain version serial numbers; The site identifier, column affiliation, content type, version number, and image hash value are concatenated according to the preset URI specification to generate a resource URI that conforms to the Uniform Resource Identifier format. The processed image files, along with their resource URIs, task metadata, processing workflow configuration snapshots, and quality benchmark evaluation results, are written into a pre-built media resource library; and the image permission attributes are configured according to the target site's access control policy, and the permission attributes are written into the access control list field of the resource metadata. It also synchronously calls the API interface of the CDN service provider to register the image file paths in the media resource library to the CDN edge node, and configures the CDN access authentication rules according to the permission attributes, including timestamp anti-hotlinking, IP whitelist and token signature verification. The CDN service returns an accelerated and optimized access link, attaches access control parameters to the access link, generates a CDN access link with access control, and writes the link into the task result data packet and returns it to the site group article editor.
10. A website group article intelligent image processing system based on the ComfyUI workflow engine, used to implement the website group article intelligent image processing method based on the ComfyUI workflow engine as described in any one of claims 1 to 9, characterized in that, include: The image preprocessing interface module is used to receive the original image and the context information of the article in the website group submitted by the user, and to perform image preprocessing on the received original image to obtain a standard image data packet. The site style profile module is used to obtain the identifiers, historical article image records, and site delivery rules of each site within the current site group management architecture to construct site style profiles. The workflow planning module is used to select and combine workflow nodes from the preset node template library based on the standard images in the standard image data package, the context information of the articles in the site group, and the site style profile, and to build workflow instances based on them; The semantic guidance module is used to input the standard images in the standardized image data package and the context information of the articles in the website group into the preset multimodal understanding model to generate a semantic guidance map, and inject it as a region-aware constraint into the workflow instance. The batch inference encapsulation module is used to export the injected workflow instance as a callable RESTful API and optimize inference parameters to adapt to batch processing scenarios. The resource management module receives batch image processing requests forwarded via the RESTful API interface, breaks them down into independent processing tasks and writes them into the request queue. Based on the containerized deployment architecture, it dynamically schedules idle ComfyUI workflow engine instances to pull tasks to be processed from the request queue, drives the corresponding workflow engine instance to execute the injected workflow instance, and obtains the processed image. The media asset integration module is used to generate a unified resource identifier for the processed images according to the site group column, content type and version number, store them in the media resource library and generate CDN access links with access control.