Method and device for generating sewing processing graphic files by text description

Through natural language processing and artificial intelligence generation models, the descriptive words entered by users are automatically converted into processing graphics files executable by sewing machine equipment, solving the problem of inefficient design of sewing processing files in the existing technology, and achieving efficient and intelligent generation of sewing processing graphics files.

CN119417929BActive Publication Date: 2025-04-22SHENZHEN XINGHUO CNC TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510010421.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-04-22
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The prior art is difficult to directly convert natural language descriptions into sewing processing graphic files that can be recognized by CNC equipment, resulting in inefficient design of processing files, relying on professional skills and unable to meet diverse sewing needs.

Method used

By combining natural language processing technology and artificial intelligence generation model, the entire process automation of the descriptive words entered by users to the processing of graphic files that can be executed by sewing machine equipment is achieved. The specific steps include multiple steps such as descriptive word verification, semantic analysis, contour extraction, and stitch optimization.

Benefits of technology

It significantly improves the efficiency and intelligence level of processing file generation, solves the inefficiency problem of relying on manual design processing files in traditional methods, and ensures the accuracy and aesthetics of processing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417929B_ABST
    Figure CN119417929B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for generating sewing processing graphic files from text descriptions. The method is mainly based on a ComfyUI server, and a Stable Diffusion model and a ControlNet model are used in combination to convert description words into pictures, and extract the picture outline to generate a stitch path. The stitch server optimizes the needle point path through an algorithm to generate a binary data packet containing coordinates, connection sequence, and space shift instructions. After receiving the data packet, the sewing machine device decodes, reconstructs the path, and performs processing operations, and finally sews the pattern corresponding to the description word onto the material. The method realizes the automation of the entire process from text to processing files, significantly improves design efficiency, and lowers the threshold for use. It is suitable for fields such as personalized design and intelligent manufacturing, and has broad application value and innovative significance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of data processing, and in particular to a method and device for generating sewing processing graphic files by text description. Background Art

[0002] In recent years, the rapid development of artificial intelligence technology has been widely used in many fields, among which the technology of generating pictures from text is particularly eye-catching. For example, generative models such as Stable Diffusion can generate high-quality pictures through input natural language. These technologies have shown significant value in fields such as artistic creation and advertising design. However, in the field of industrial control, despite the rich needs, such as the processing graphic design of complex mechanical parts and the rapid visualization of the manufacturing process, practical applications based on such generation technologies have not yet been seen. In particular, industrial processing graphic files usually need to have extremely high precision and standardization requirements to meet the operating requirements of CNC equipment, and the existing text-to-picture technology is not optimized for the specific needs of this field.

[0003] There is a significant gap between the current text-generated image technology and the actual processing purpose. On the one hand, most of these technologies are visually oriented, and the generated images focus on aesthetics and artistic expression, but lack constraints on the accuracy of industrial graphic files. For example, the generated images may not strictly meet the geometric dimensions and processing requirements of specific mechanical parts. In addition, although traditional CAD (computer-aided design) tools can accurately design processing graphics, they are complex to operate and have low design efficiency, which is inconsistent with the efficient and fast requirements of modern intelligent production. This shortcoming makes it impossible for the industrial field to effectively utilize the existing AI-generated image technology, thereby limiting the promotion and application of the technology.

[0004] In order to make up for the above shortcomings, it is particularly important to study a generation method for industrial processing needs. The ideal technology should be able to directly convert natural language descriptions into processing graphic files that can be recognized by CNC equipment. This requires not only that the generated graphic files meet the geometric accuracy and process requirements, but also that they are seamlessly compatible with existing industrial standards so that they can be directly used for processing. Summary of the invention

[0005] The main purpose of the present invention is to provide a method and device for generating sewing processing graphic files from text descriptions, so as to solve the technical problems in the prior art that there is a lack of methods that can directly generate sewing processing graphic files from natural language descriptions, resulting in low efficiency in processing file design, reliance on professional skills, and inability to meet diverse sewing needs.

[0006] To achieve the above-mentioned purpose, the present invention provides a method for generating a sewing processing graphic file from a text description, comprising: obtaining a description word input by a user through a sewing machine device, and verifying the description word to obtain the semantic accuracy of the description word, and when the semantic accuracy of the description word is higher than a first threshold, converting the description word into an initial data packet and sending it to a stitch server; using the stitch server to parse the initial data packet, screening and combining workflow data corresponding to the initial data packet from multiple preset workflow parameters, integrating the workflow data and the initial data packet into workflow data in a preset format, and sending the workflow data to a stitch server. The data is sent to the ComfyUI server; the ComfyUI server is used to parse the workflow data, and data processing is performed according to the parsing result to obtain and store the initial contour image corresponding to the descriptive word; the stitch server is used to retrieve the initial contour image corresponding to the descriptive word stored in the ComfyUI server, and the initial contour image is converted into a needle point set of sewing stitches, and the needle point set is converted into binary data and sent to the sewing machine device; the sewing machine device performs stitch point traversal and recognition on the binary data to obtain needle point data that can be actually processed by the machine, and the sewing machine device is used to execute the needle point data.

[0007] The present invention also provides a device for generating a sewing processing graphic file by text description, comprising: a first unit, for obtaining a description word input by a user through a sewing machine device, and performing verification processing on the description word to obtain the semantic accuracy of the description word, and when the semantic accuracy of the description word is higher than a first threshold, converting the description word into an initial data packet and sending it to a stitch server; a second unit, for using the stitch server to parse the initial data packet, screening and combining workflow data corresponding to the initial data packet from a plurality of preset workflow parameters, integrating the workflow data and the initial data packet into workflow data in a preset format, and sending the workflow data to Co mfyUI server; a third unit, used to use the ComfyUI server to parse the workflow data, and perform data processing according to the parsing result to obtain and store the initial contour image corresponding to the descriptive word; a fourth unit, used to use the stitch server to retrieve the initial contour image corresponding to the descriptive word stored in the ComfyUI server, and convert the initial contour image into a needle point set of sewing stitches, and convert the needle point set into binary data and send it to the sewing machine device; a fifth unit, used to perform stitch point traversal and recognition on the binary data through the sewing machine device, obtain needle point data that can be actually processed by the machine, and execute the needle point data using the sewing machine device.

[0008] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0009] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0010] The method and device for generating sewing processing graphic files from text description provided by the present invention can directly convert the description words input by the user into processing graphic files executable by the sewing machine equipment by combining natural language processing technology and artificial intelligence generation model, which significantly improves the efficiency and intelligence level of processing file generation. The prior art lacks a mature solution for directly using text description for sewing processing, and the present invention realizes the automation of the whole process from text description to processing file through multi-step processing such as word segmentation, semantic matching, contour extraction, and stitch optimization, solving the inefficiency problem of relying on manual design of processing files in traditional methods.

[0011] At the same time, the present invention also ensures that the trace points in the contour image have good continuity and smoothness through an optimized trace generation algorithm, avoids needle breakage or path deviation during processing, and improves the accuracy and aesthetics of the processing results. Combining the flexible workflow configuration of ComfyUI and the contour extraction function of ControlNet, the present invention effectively solves the technical difficulties in converting from natural language description to machine executable data, and has significant creativity and practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is a schematic diagram of a method for generating a sewing processing graphic file by text description in one embodiment of the present invention;

[0013] Figure 2 is a schematic diagram related to generating a sewing processing graphic file by text description in one embodiment of the present invention;

[0014] Figure 3 It is a structural diagram of a device for generating a sewing processing graphic file by text description in one embodiment of the present invention;

[0015] Figure 4 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0016] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0018] Reference Figure 1 The embodiment of the present invention provides a method for generating a sewing processing graphic file by text description, comprising the following steps:

[0019] S1, obtaining the description word input by the user through the sewing machine device, and verifying the description word to obtain the semantic accuracy of the description word. When the semantic accuracy of the description word is higher than a first threshold, converting the description word into an initial data packet and sending it to the stitch server.

[0020] S2, using the trace server to parse the initial data packet, screening and combining the workflow data corresponding to the initial data packet from multiple preset workflow parameters, integrating the workflow data and the initial data packet into workflow data in a preset format, and sending the workflow data to the ComfyUI server.

[0021] S3, using the ComfyUI server to parse the workflow data, and performing data processing according to the parsing result to obtain and store the initial contour image corresponding to the description word.

[0022] S4, using the stitch server to retrieve the initial contour image corresponding to the descriptive word stored in the ComfyUI server, and converting the initial contour image into a needle point set of sewing stitches, converting the needle point set into binary data and sending it to the sewing machine device.

[0023] S5, performing stitch point traversal identification on the binary data through the sewing machine device to obtain needle point data that can be actually processed by the machine, and using the sewing machine device to execute the needle point data.

[0024] That is, a complete conversion from the text description input by the user to the sewing graphic file that can be actually processed by the machine is achieved through multiple steps. First, in step S1, the user inputs a descriptive word, such as "a sunflower", through the control end of the sewing machine device. The device will verify the descriptive word input by the user. This process includes operations such as word segmentation, semantic extraction, and semantic matching to ensure that the input descriptive word can be accurately understood by the subsequent AI processing module. By calculating the semantic accuracy, the system can determine whether the input descriptive word is clear and meets expectations. If the semantic accuracy is higher than the preset first threshold, it means that the descriptive word can be effectively parsed by the AI ​​module. At this time, the system will convert the descriptive word into an initial data packet and send it to the stitch server through the TCP protocol for further processing.

[0025] In step S2, after receiving the initial data packet, the trace server processes the description words through the parsing algorithm, extracts the semantic information therein and matches it with the preset workflow parameters. In order to achieve the best adaptation of the description words and the subsequent image generation module, the trace server will filter out multiple parameters related to the description words, such as the word segmenter type, AI model selection, image generation style and resolution, etc. The filtered parameters will be integrated with the initial data packet into a workflow data packet, which uses the preset JSON format and contains the content of the description words, semantic tags, and specific configuration of the workflow. After completing the construction of the workflow data, the trace server will send it to the ComfyUI server via the HTTP protocol to start the image generation and processing process.

[0026] Then, in step S3, the ComfyUI server parses the workflow data and calls the corresponding AI model according to the description words and parameters. First, the description words are converted into vector matrices through the word segmenter and input into the StableDiffusion model to generate an initial image related to the description words. The generated initial image is not used directly for sewing, but needs to be extracted through the ControlNet model. In this process, the ControlNet model will identify the main boundaries and shapes in the initial image and output a contour image that is highly semantically related to the description words. The generation and storage of contour images is the key to the entire process. It converts visual content from abstract descriptions into input that can be processed by the stitch generation algorithm. The generated contour image is finally stored in the cache directory of the ComfyUI server for further calls by the stitch server.

[0027] In step S4, the stitch server retrieves the cache directory of the ComfyUI server, locates the contour image file corresponding to the description word and loads the file. Next, the stitch server extracts the point data in the contour image through a traversal algorithm and converts it into a set of needle points for sewing stitches. In order to ensure the continuity of the stitches and the optimization of the processing path, the system adopts a sorting algorithm based on the shortest path to arrange the extracted needle points and generate a coherent stitch path. Subsequently, the needle point path is further processed into binary data in a specific format, which not only contains the coordinate information of the needle points, but also includes the connection order between the points and the idle shift instructions. These binary data are sent to the sewing machine equipment through the TCP protocol to provide complete data support for the final processing task.

[0028] Finally, in step S5, after the sewing machine device receives the binary data from the stitch server, it calls the internal parsing module to decode it and generates a processing instruction containing needle point information and path planning. The device traverses the stitch point data point by point, reconstructs the processing path and identifies the empty shift area to ensure the continuity of the processing process. At the same time, the path planning module of the device will further optimize the needle point path according to the characteristics of the processing material, such as adjusting the stitch density and processing speed to meet specific sewing requirements. After the processing path is loaded, the sewing machine device starts to perform the sewing operation, and accurately presents the content described by the user to the target material through sewing stitches. During the processing process, the device will monitor the processing quality in real time to ensure the accuracy and continuity of the stitches, and will generate a result report for the user to view after the processing is completed.

[0029] Through the above method, the present invention realizes the fully automated generation of sewing processing files from text description, greatly improves the efficiency of processing file design, and reduces the dependence on professional design skills. The entire technical solution not only covers the comprehensive application of natural language processing, AI generation model, image processing and industrial control technology, but also realizes technical innovation from abstract semantics to actual processing through multi-module collaboration, which fully reflects the practicality and creativity of the present invention.

[0030] In one example, the description word is verified to obtain the semantic accuracy of the description word, and when the semantic accuracy of the description word is higher than a first threshold, the description word is converted into an initial data packet, including: performing word segmentation on the description word by a preset word segmentation algorithm to extract key semantic components in the description word; inputting the extracted key semantic components into a trained semantic matching model, and comparing them with a preset semantic vocabulary to obtain a matching score between the description word and a target semantic vocabulary; weighting the matching score using a weighted calculation formula according to the matching score and the length of the description word input by the user to obtain the semantic accuracy of the description word; comparing the semantic accuracy with a first threshold, and when the semantic accuracy is higher than the first threshold, generating a verification pass mark, and converting the description word into an initial data packet; when the semantic accuracy is lower than or equal to the first threshold, generating a verification failure prompt message, and feeding back to the user through the sewing machine device, prompting the user to modify the description word.

[0031] That is, the system verifies the description words entered by the user to ensure that the description words can be accurately identified and parsed by the subsequent processing flow. The goal of the entire process is to evaluate the semantic accuracy of the description words and decide whether to convert the description words into initial data packets for subsequent steps based on the evaluation results.

[0032] First, the system will segment the description words entered by the user. Here, the preset segmentation algorithm is used to break down the description words into several key semantic components. For example, when the user enters "a sunflower", the segmentation algorithm will break it down into key components such as "sunflower" and "a". These key components are the core semantic information of the description words, and they will serve as the basis for subsequent matching and evaluation.

[0033] Next, the extracted key semantic components will be input into a trained semantic matching model, which is responsible for comparing these key components with the system's preset semantic vocabulary. The semantic vocabulary contains a large number of reference semantics related to image generation, such as "flowers", "animals", "natural landscapes", etc. The matching model calculates the matching score between the descriptive word and the target semantic vocabulary by comparison, measuring the relevance of the descriptive word to the known semantics. For example, "sunflower" may have a high matching degree in the vocabulary, while some vague or uncommon descriptive words may have a lower score.

[0034] The system then adjusts the match score using a weighted calculation formula based on the match score and the length of the user-entered description. The weighted formula is designed to balance the difference between short and long descriptions. For example, a short description word "flower" may score high, but in practice, it is less specific and clear, so its semantic accuracy needs to be reduced through weighting. A more detailed description like "a sunflower" will have higher semantic accuracy due to the length factor.

[0035] The final semantic accuracy is compared with the first threshold set by the system. If the semantic accuracy is higher than the threshold, the system will generate a "verification passed" mark, indicating that the description word is semantically clear and suitable for further processing. At the same time, the description word will be converted into an initial data packet and sent to the stitch server in a standardized format to start the subsequent workflow. If the semantic accuracy is lower than or equal to the first threshold, the system will generate a "verification failed" prompt message and feedback this information to the user through the sewing machine device, prompting the user to modify the input description word to make it clearer or more specific.

[0036] This design not only ensures that the description words entered by the user can be accurately parsed by the AI ​​system, but also improves the reliability and quality of the subsequent generated processing graphics files. Through the introduction of semantic verification, the system can effectively filter out semantically ambiguous or unprocessable inputs, avoiding errors in the subsequent processing flow or generating meaningless results.

[0037] In one example, the trace server is used to parse the initial data packet, and the workflow data corresponding to the initial data packet is screened and combined from multiple preset workflow parameters, including: segmenting the descriptive words in the initial data packet through a parsing algorithm, and extracting semantic tags related to the descriptive words; according to the semantic tags, retrieving a preset workflow parameter library, and screening the segmenter type, model style parameters, image resolution parameters and post-processing module configuration that match the semantic tags; combining the screened parameters to construct workflow data adapted to the descriptive words; integrating the workflow data and the initial data packet into workflow data in a preset format, wherein the workflow data includes the descriptive words of the initial data packet, the corresponding semantic tags and the screened workflow parameters.

[0038] That is, the trace server is responsible for parsing the initial data packet formed by the descriptive words entered by the user into workflow data suitable for subsequent AI processing. The purpose of the whole process is to filter out appropriate configuration parameters from the preset workflow parameter library based on the semantic characteristics of the descriptive words and integrate them into a complete workflow data.

[0039] First, the trace server processes the descriptive words in the initial data packet through a parsing algorithm, focusing on extracting the semantic tags of the descriptive words. After the descriptive words are decomposed into several semantic components by the word segmentation algorithm, these components are further mapped to semantic tags. For example, if the input descriptive word is "a flying bird", after word segmentation, components such as "bird" and "flying" may be extracted, and these components are converted into semantic tags, such as "animal" and "dynamic action". The semantic tag is the core abstraction of the descriptive word content, which can help the system quickly match the relevant workflow parameters.

[0040] Next, the trace server retrieves appropriate parameters from the preset workflow parameter library based on the generated semantic tags. The workflow parameter library stores a variety of configuration options related to image generation and processing, such as word segmenter types (such as basic word segmenters, advanced semantic word segmenters), AI model style parameters (such as cartoon style, realistic style, 3D style), image resolution parameters (such as high-definition or low-definition mode), and the configuration of subsequent processing modules (such as contour extraction, detail enhancement, etc.). Based on the semantic tags of the descriptive words, the system will filter out the best matching word segmenter type, generate model parameters, etc. For example, for the semantic tags "bird" and "dynamic action", the system may select a model with enhanced dynamic effects and set a higher resolution to highlight the details of the image.

[0041] The system then combines the screened parameters to construct a workflow data that is suitable for the descriptive words. The combination process must not only consider the independence of each parameter, but also ensure their compatibility. For example, the semantic data format output by the word segmenter needs to match the subsequent AI model input format, and the choice of image resolution must also be consistent with the range supported by the post-processing module. Through this combination, the system generates a complete workflow data that can guide the AI ​​model to accurately generate images corresponding to the descriptive words.

[0042] Finally, the trace server integrates the constructed workflow data with the initial data package and organizes it into a preset workflow data format. This format is usually standardized, such as JSON format, which is convenient for subsequent ComfyUI server parsing and execution. The workflow data contains not only the initial descriptors, but also their corresponding semantic tags and filtered workflow parameters. This structured data makes it easier for the AI ​​model to efficiently call related modules and achieve the optimal effect of image generation and processing.

[0043] Through this process, the stitch server undertakes the key task of converting from description words to workflow data, ensuring that the generated workflow data can accurately reflect user needs and is highly matched with the processing capabilities of the AI ​​model. This mechanism greatly improves the flexibility and applicability of the system, allowing high-quality images to be generated through parameter combinations regardless of whether the description words are simple or complex, laying a solid foundation for subsequent contour extraction and processing file generation.

[0044] In one example, sending the workflow data to the ComfyUI server includes: sending the generated workflow data to the ComfyUI server via the HTTP protocol for subsequent image generation and processing module to call.

[0045] That is, the sending of workflow data packets is an important interactive link between the system and the ComfyUI server, and its purpose is to pass the constructed workflow data to the ComfyUI server so that it can parse and start the image generation and subsequent processing flow.

[0046] First, the workflow data package is generated by the trace server in the previous step. This data package is usually in a structured format (such as JSON), which includes the descriptive words entered by the user, the semantic tags of the descriptive words, and the workflow parameters matched for the descriptive words. These parameters may involve the type of word segmenter, the configuration of the AI ​​model, the image generation style and resolution settings, etc. The design of the workflow data package ensures that it can accurately describe the entire workflow required from text to image generation, providing clear guidance for subsequent processing modules.

[0047] In this link, the Line Trace server sends the generated workflow data to the ComfyUI server through the HTTP protocol. The HTTP protocol is a commonly used network communication protocol with the characteristics of high reliability and stable transmission, which is very suitable for this cross-module data transmission. Inside the Line Trace server, the system will package the workflow data according to the preset communication rules and send an HTTP request to the ComfyUI server. For example, this request may be a POST request that contains the workflow data as the request body. When sending, the Line Trace server will specify the IP address or domain name of the ComfyUI server and the corresponding port number (such as 8188) to ensure that the data can accurately reach the target server.

[0048] After receiving the HTTP request, the ComfyUI server will parse the workflow data package contained therein and start the corresponding image generation and processing modules according to the content of the data package. For example, the server will load the corresponding AI model according to the word segmenter type and model parameters specified in the workflow, and adjust the generation process according to the image generation style and resolution requirements. Through this mechanism, the workflow data package becomes the core data to guide the operation of the ComfyUI server, enabling it to generate expected images according to the specific needs of users.

[0049] The key to this link is that the content and format of the workflow data packet need to fully match the parsing logic of the ComfyUI server, otherwise the data may not be parsed or processed correctly. In addition, the use of the HTTP protocol ensures that the data will not be tampered with or lost during transmission, thereby improving the reliability and stability of the entire system. By sending the workflow data to the ComfyUI server, the stitch server completes the key steps from description word processing to image generation instruction delivery. This process not only connects the functions of different modules, but also enables the system to have modular and distributed processing capabilities, laying an important technical foundation for image generation and processing.

[0050] In one example, the ComfyUI server is used to parse the workflow data, and data processing is performed according to the parsing results to obtain and store the initial contour image corresponding to the descriptive word, including: receiving and parsing the descriptive words and the corresponding workflow parameters in the workflow data, loading a word segmenter and a StableDiffusion model that match the workflow parameters; using the word segmenter to vectorize the descriptive words to generate a semantic vector matrix of the descriptive words; inputting the semantic vector matrix into the Stable Diffusion model, and outputting an initial image related to the descriptive words according to the generation rules of the model; inputting the initial image into the ControlNet model, processing the initial image through an image contour extraction algorithm, and generating a contour image that semantically matches the descriptive word; formatting the contour image, and storing the processed contour image in the cache directory of the ComfyUI server for subsequent process calls.

[0051] That is, the ComfyUI server is responsible for parsing the workflow data and generating the initial contour image corresponding to the descriptive word. This process is an important step in the conversion from text to image. Through the collaboration of multiple artificial intelligence models, a contour image that can be used for subsequent processing is finally generated.

[0052] First, the ComfyUI server receives the workflow data packet sent by the trace server and parses the content. The workflow data contains the descriptive words entered by the user and their corresponding workflow parameters, including the word segmenter type, AI model configuration, generation style and resolution. Based on these parameters, the ComfyUI server loads the adapted word segmenter and Stable Diffusion model to ensure that the subsequent image generation process can be executed accurately.

[0053] Next, the server uses the loaded word segmenter to vectorize the description word. The word segmenter decomposes the description word into several semantic components and converts these components into a semantic vector matrix. This semantic vector matrix is ​​the representation of the description word in mathematical space, which contains the semantic features of the description word and can be used as the input of the Stable Diffusion model. For example, if the input description word is "a sunflower", the vector matrix will encode the semantic information such as the shape, color features and number of "sunflowers" of the "sunflower".

[0054] The generated semantic vector matrix is ​​then input into the Stable Diffusion model, which converts the semantic vector into an initial image based on the preset generation rules. This image is highly semantically related to the descriptive word, for example, "a sunflower" will generate a complete picture of a sunflower. The generation rules of the Stable Diffusion model are adjusted according to the workflow parameters to ensure that the image style and resolution meet the user's needs.

[0055] The generated initial image is not the final file for processing and needs further processing. The ComfyUI server inputs the initial image into the ControlNet model, using its powerful image contour extraction capabilities to identify the boundaries and main contours of the image through image analysis algorithms. The final contour image is a simplified version of the initial image, retaining only the key contour information corresponding to the descriptor, such as the petal shape and stem and leaf contours of a sunflower.

[0056] To facilitate subsequent calls, the ComfyUI server formats the generated contour image, usually saving it in a standard image file format (such as PNG or JPEG). The purpose of formatting is to ensure that the contour image can be seamlessly loaded and processed by subsequent modules. After processing, the contour image is stored in the cache directory of the ComfyUI server, waiting for the stitch server to retrieve and continue processing.

[0057] Through this process, the ComfyUI server converts the abstract text description into a visual contour image, completing the key step from semantics to graphics. This multi-level processing method based on word segmentation, Stable Diffusion model and ControlNet model not only ensures the accuracy and consistency of image generation, but also improves the overall efficiency of the system through distributed collaboration. The generation of contour images lays an important foundation for the subsequent line point extraction and processing file generation, making the entire process more intelligent and efficient.

[0058] In one example, the stitch server is used to retrieve the initial contour image corresponding to the descriptive word stored in the ComfyUI server, and the initial contour image is converted into a needle point set of sewing stitches, and the needle point set is converted into binary data and sent to the sewing machine device, including: accessing the cache directory of the ComfyUI server through a preset retrieval algorithm, and locating the corresponding initial contour image file according to the unique identifier of the descriptive word; loading the initial contour image file, and traversing the image through a contour point extraction algorithm to identify the two-dimensional coordinate set of contour points point by point; based on the coordinate set of contour points, using an optimized sorting algorithm to calculate the shortest path between contour points and generate a continuous needle point path set; interpolation calculation and smoothing processing are performed on the needle point path set to ensure the continuity of the stitch and the smoothness of the processing; converting the processed needle point path set into a binary data packet in a specific format, which contains the coordinate information, connection order and idle shift instructions of the needle points; sending the binary data packet to the sewing machine device through the TCP protocol to provide data support for subsequent processing.

[0059] That is, the stitch server retrieves the initial contour image from the ComfyUI server and converts it into a set of needle points and a binary data packet that the sewing machine can understand and execute. This process is a key link in the transformation from image to machine processing instructions, ensuring that the geometric features of the image can be accurately reflected in the sewing process. First, the stitch server accesses the cache directory of the ComfyUI server through a preset retrieval algorithm. The ComfyUI server has generated and stored the initial contour image files in the previous stage, which are usually named with unique identifiers for quick positioning. The stitch server accurately finds the matching contour image file based on the unique identifier of the descriptor, such as the corresponding hash value or file name. This retrieval process ensures efficient access to image data by the server.

[0060] Next, the stitch server loads the located initial contour image file and traverses the image content point by point using the contour point extraction algorithm. The contour point extraction algorithm scans the pixels in the image line by line, identifies the key points that constitute the image boundary, and records the two-dimensional coordinates of these key points. For example, for a sunflower contour image, the algorithm extracts the boundary points of the main parts such as petals, stems and leaves, which will form the basis of the needle point set.

[0061] After extracting the coordinate set of the contour points, the stitch server calculates the shortest path between the contour points through an optimized sorting algorithm. This process aims to organize discrete contour points into a continuous needle point path to avoid skipped or broken needles during processing. For example, the algorithm will prioritize connecting adjacent contour points while minimizing the path's empty distance to generate a smooth processing path.

[0062] The generated needle point path set may still have irregularities, so the system will perform interpolation and smoothing. Interpolation is used to generate additional intermediate points between points in the path, thereby improving the density and accuracy of the path; smoothing eliminates sharp corners and abrupt points in the path through mathematical algorithms (such as Bezier curve fitting), making the processing path more continuous and smooth. This step ensures that the sewing stitches have high aesthetics and reliability in actual processing.

[0063] After completing the path optimization, the stitch server converts the processed needle point path set into a binary data packet in a specific format. The binary data packet contains the two-dimensional coordinate information of the needle points, the connection order, and key information required for processing, such as the idle shift instruction. The idle shift instruction is used to instruct the sewing machine how to move the stitches when it needs to skip the non-processed area, thereby optimizing the processing efficiency. Finally, the stitch server sends the generated binary data packet to the sewing machine device through the TCP protocol. The use of the TCP protocol ensures the reliability and accuracy of data transmission, and avoids processing failures due to data loss or errors during the processing process. After receiving the binary data packet, the sewing machine device can directly decode and execute the needle point path to achieve accurate processing of the pattern corresponding to the user description word.

[0064] This process converts the contour image into a machine-executable data format, which not only ensures the accuracy and efficiency of processing, but also provides users with a highly automated experience. Through optimized point extraction and path generation algorithms, the system ensures a high degree of consistency between the processing results and user requirements in detail, while reducing dependence on manual intervention.

[0065] In one example, the sewing machine device performs stitch point traversal and identification on the binary data to obtain needle point data that can be actually processed by the machine, and the sewing machine device is used to execute the needle point data, including: the sewing machine device receives a binary data packet sent by a stitch server, parses the binary data through a built-in decoding module, and extracts stitch point information including needle point coordinates, connection sequence and idle shift instructions; traverses the stitch point information point by point, reconstructs the stitch path according to the connection sequence of the needle points, and performs path jumps on areas with idle shift instructions to ensure error-free connection during processing. The device then processes the sewing process according to the following steps: calling the path planning module inside the device, fine-tuning the needle point path according to the characteristics of the processing material and the stitch density requirements, and generating final needle point data suitable for the device processing; loading the final needle point data into the processing control module of the device, and automatically adjusting the working parameters of the sewing machine, including stitch speed, tension control and path execution speed, to ensure that the sewing effect meets expectations; the sewing machine device performs processing operations according to the final needle point data, sews the content corresponding to the description word onto the target material, and detects the needle point accuracy and stitch continuity during the processing process through the built-in real-time monitoring module of the device.

[0066] That is, the main task of the sewing machine is to receive the binary data packets sent from the stitch server, parse and generate actual executable needle path data, and then perform the sewing task. This process covers the complete workflow from data parsing to path planning and actual processing, ensuring that the final processing result is highly consistent with the requirements of the user's description words.

[0067] First, the sewing machine receives the binary data packet sent by the stitch server through the TCP protocol. The data packet contains the core information of the needle point, including the two-dimensional coordinates of each needle point, the connection order between the needle points, and the idle shift instruction. After receiving the data packet, the sewing machine device calls its built-in decoding module to parse the data packet. This decoding process converts the binary data into structured stitch point information, providing a basis for subsequent processing operations. Next, the device traverses the parsed stitch point information point by point and reconstructs the complete stitch path according to the connection order of the needle points. When reconstructing the path, the system will also perform path jumps in necessary areas according to the idle shift instruction. For example, when there is a non-processing area that needs to be skipped in a certain path, the device will move the needle according to the idle shift instruction without performing sewing, thereby avoiding errors in stitch continuity. The focus of this step is to ensure the continuity of the processing path so that the final sewing effect accurately reflects the original contour image.

[0068] After completing the path reconstruction, the sewing machine device calls its internal path planning module to optimize and adjust the reconstructed path. The path planning module will fine-tune the path according to the characteristics of the processing material (such as thickness, flexibility, etc.) and the requirements of the stitch density. For example, for harder materials, the system may reduce the density of stitches to reduce the pressure between stitches; while for delicate patterns, the system will increase the stitch density to improve the detail performance of the stitches. This fine-tuning process generates the final needle point data suitable for equipment processing. The generated final needle point data is then loaded into the processing control module of the device. The processing control module automatically adjusts the sewing machine's operating parameters such as stitch speed, tension control, path execution speed, etc. according to the needle point data. For example, in the curved part of the path, the device may reduce the stitch speed to ensure accuracy; while in the straight area, the speed will be appropriately increased to improve efficiency. Such automatic adjustment ensures that the processing effect is both in line with the pattern design and can be completed efficiently.

[0069] When all parameters are adjusted, the sewing machine begins to actually perform the processing operation. The device sews the pattern corresponding to the descriptor onto the target material according to the final needle point path. For example, when the descriptor is input as "a sunflower", the sewing machine accurately sews a sunflower pattern according to the generated needle point path. During the processing, the real-time monitoring module of the device continuously detects the processing accuracy of each needle point and the continuity of the stitches. For example, if broken needles or discontinuous stitches are found in certain areas, the device will automatically adjust the processing path or generate prompt information for the user to check and correct.

[0070] Through this complete process, the sewing machine successfully converts binary data into physical processing results, achieving accurate sewing from data to physical patterns. This method combines multiple technologies of data analysis, path optimization and processing control to ensure that the processing results not only meet the requirements of user input, but also have good process quality and visual effects. The whole process fully reflects the intelligent and automated characteristics of the equipment, providing an efficient and accurate solution for sewing complex patterns.

[0071] In order to facilitate understanding of the technical solution, another embodiment is now provided for explanation:

[0072] like Figure 2 As shown, a method and device for applying AI generation technology to sewing processing solves the current problems of low efficiency and low automation of manually designed processing files. The core is to use the technology of generating pictures from text, combined with the stitch generation algorithm, to achieve full process automation from user input of description words to sewing processing files. The following is a summary of the technical implementation process of the present invention and its application examples.

[0073] The core of the technical implementation is to use ComfyUI as a processing platform for text-generated images, call the Stable Diffusion model through the HTTP interface to convert the description words into images, and then extract the contour images of the images in combination with the ControlNet model. The self-developed stitch server converts these contour images into needle point paths that can be used for sewing through the TCP interface, and finally the sewing machine completes the processing operation. The entire process is implemented on the premise that the server is deployed and successfully connected to the sewing machine. When the user enters a description word through the sewing machine, such as "a sunflower", the description word will be sent to the stitch server through the TCP protocol in UTF-8 encoding. After receiving it, the stitch server embeds the description word into the workflow of ComfyUI. The workflow uses the JSON format and defines the complete processing flow of description word parsing, model calling and parameter configuration. The workflow data is passed to the ComfyUI server through the HTTP protocol.

[0074] After the ComfyUI server parses the workflow, it calls the Stable Diffusion model to process the description words. The description words are first converted into a semantic vector matrix through the word segmenter, and then input into the Stable Diffusion model to generate initial images related to the semantics of the description words. These images are then extracted by the ControlNet model to generate simplified contour images and stored in the local directory of the server. This contour image contains the key geometric information of the pattern corresponding to the description word, providing a basis for subsequent stitch generation.

[0075] The stitch server retrieves the corresponding contour image from the cache directory of the ComfyUI server, and extracts the two-dimensional coordinate set of the contour image point by point through a traversal algorithm. These coordinate points are organized into needle point paths, and the continuity and smoothness of the path are ensured by optimizing the sorting algorithm. For contour points that are far away, the system generates empty shift instructions to optimize processing efficiency. The processed needle point path is further optimized through interpolation and smoothing algorithms to ensure the smoothness of the path and the consistency of stitch density. The final generated needle point path set is converted into a binary data packet in a specific format, containing information such as needle point coordinates, connection order, and empty shift instructions, and is sent to the sewing machine device through the TCP protocol.

[0076] After receiving the binary data, the sewing machine equipment parses the needle point information through the built-in decoding module and rebuilds the processing path according to the path sequence. For the empty shift area, the equipment skips unnecessary sewing according to the instructions to ensure the accuracy of the processing results. The path planning module in the equipment further optimizes the processing path, adjusts the stitch speed, tension control and path execution parameters according to the characteristics of the processing material and the stitch density requirements, and ensures that the processing quality meets expectations. After these adjustments, the path is loaded into the processing control module of the equipment. The sewing machine finally performs the sewing task according to the processing file and accurately sews the pattern corresponding to the description word onto the target material.

[0077] During the processing, the real-time monitoring module of the sewing machine will detect the accuracy of needle point processing and the continuity of stitches to ensure the processing quality. After the processing is completed, the user can directly view the results on the device interface and adjust the input description words or model parameters as needed. The integrity and automation of this process allows users to generate expected processing files and complete sewing processing without professional design skills, just by entering a sentence.

[0078] The implementation of the present invention requires a computer equipped with a GPU graphics card as an AI server, and interconnection with the sewing machine device through a local area network or the cloud. Taking the RTX4060 graphics card as an example, the user can deploy the Docker environment on a computer running Windows 10 or above, and install the ComfyUI service and the stitch service. According to the needs, select a suitable Wenshengtu model, such as cartoon, realistic or 3D style, and load it into the ComfyUI service, and the user can directly generate processing files through the sewing machine device.

[0079] The innovation of the present invention lies in the fact that AI text generation technology is applied to the field of sewing processing for the first time, solving the problems of low efficiency and high professional threshold in traditional processing file design. Compared with the prior art, this method not only has a high degree of automation, but also significantly reduces the difficulty of use, allowing ordinary users to complete the sewing processing of complex patterns with simple text input. In addition, by combining image contour extraction with an optimized stitch generation algorithm, the present invention effectively ensures the accuracy and practicality of the processing file, further improving the quality of the processing results.

[0080] like Figure 3 As shown, an embodiment of the present invention provides a device for generating a sewing processing graphic file by text description, comprising:

[0081] The first unit 1 is used to obtain a description word input by a user through a sewing machine device, and perform verification processing on the description word to obtain the semantic accuracy of the description word. When the semantic accuracy of the description word is higher than a first threshold, the description word is converted into an initial data packet and sent to a stitch server;

[0082] The second unit 2 is used to parse the initial data packet using the stitch server, filter and combine the workflow data corresponding to the initial data packet from a plurality of preset workflow parameters, integrate the workflow data and the initial data packet into workflow data in a preset format, and send the workflow data to the ComfyUI server;

[0083] The third unit 3 is used to parse the workflow data using the ComfyUI server, and perform data processing according to the parsing result to obtain and store the initial contour image corresponding to the description word;

[0084] The fourth unit 4 is used to use the stitch server to retrieve the initial contour image corresponding to the description word stored in the ComfyUI server, convert the initial contour image into a needle point set of sewing stitches, convert the needle point set into binary data and send it to the sewing machine device;

[0085] The fifth unit 5 is used to perform stitch point traversal identification on the binary data through the sewing machine device to obtain needle point data that can be actually processed by the machine, and to execute the needle point data using the sewing machine device.

[0086] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0087] Reference Figure 4 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.

[0088] Those skilled in the art will understand that Figure 4 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0089] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0091] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0092] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for generating sewing processing graphic files by text description, characterized in that: The following steps are involved: Obtaining the description word input by the user through the sewing machine device, and verifying the description word to obtain the semantic accuracy of the description word, and when the semantic accuracy of the description word is higher than a first threshold, converting the description word into an initial data packet and sending it to the stitch server; The initial data packet is parsed by the thread trace server, workflow data corresponding to the initial data packet is screened and combined from a plurality of preset workflow parameters, the workflow data and the initial data packet are integrated into workflow data in a preset format, and the workflow data is sent to the ComfyUI server; The ComfyUI server is used to parse the workflow data, and data processing is performed according to the parsing result to obtain and store the initial contour image corresponding to the description word; The stitch server is used to retrieve the initial contour image corresponding to the description word stored in the ComfyUI server, and the initial contour image is converted into a needle point set of sewing stitches, and the needle point set is converted into binary data and sent to the sewing machine device; The sewing machine device performs stitch point traversal identification on the binary data to obtain needle point data that can be actually processed by the machine, and the sewing machine device is used to execute the needle point data.

2. The method according to claim 1, characterized in that Performing verification processing on the description word to obtain the semantic accuracy of the description word, and converting the description word into an initial data packet when the semantic accuracy of the description word is higher than a first threshold, includes: Performing word segmentation processing on the description words by using a preset word segmentation algorithm to extract key semantic components in the description words; Inputting the extracted key semantic components into the trained semantic matching model, comparing them with the preset semantic vocabulary, and obtaining the matching score between the descriptive word and the target semantic vocabulary; According to the matching score and the length of the description word input by the user, the matching score is weighted by using a weighted calculation formula to obtain the semantic accuracy of the description word; Comparing the semantic accuracy with a first threshold, generating a verification passed mark when the semantic accuracy is higher than the first threshold, and converting the description word into an initial data packet; When the semantic accuracy is lower than or equal to the first threshold, a prompt message indicating that the verification has not passed is generated and fed back to the user through the sewing machine device, prompting the user to modify the description word.

3. The method according to claim 1, characterized in that The initial data packet is parsed by the trace server, and workflow data corresponding to the initial data packet is screened and combined from a plurality of preset workflow parameters, including: Perform word segmentation processing on the description words in the initial data packet by using a parsing algorithm to extract semantic tags related to the description words; According to the semantic tag, a preset workflow parameter library is retrieved to filter out a word segmenter type, a model style parameter, an image resolution parameter, and a post-processing module configuration that matches the semantic tag; Combining the selected parameters to construct workflow data suitable for the descriptive words; The workflow data and the initial data packet are integrated into workflow data in a preset format, wherein the workflow data includes a descriptive word of the initial data packet, a corresponding semantic tag, and filtered workflow parameters.

4. The method according to claim 1, characterized in that: Sending the workflow data to the ComfyUI server includes: sending the generated workflow data to the ComfyUI server through the HTTP protocol for subsequent image generation and processing module to call.

5. The method according to claim 1, characterized in that The ComfyUI server is used to parse the workflow data, and data processing is performed according to the parsing result to obtain and store the initial contour image corresponding to the description word, including: Receive and parse the descriptive words and corresponding workflow parameters in the workflow data, and load a word segmenter and a Stable Diffusion model that match the workflow parameters; Using the word segmenter to vectorize the description words to generate a semantic vector matrix of the description words; Inputting the semantic vector matrix into a Stable Diffusion model, and outputting an initial image related to the description word according to a generation rule of the Stable Diffusion model; Inputting the initial image into the ControlNet model, processing the initial image by an image contour extraction algorithm, and generating a contour image that semantically matches the description word; The outline image is formatted and stored in a cache directory of the ComfyUI server for subsequent process calls.

6. The method according to claim 1, characterized in that The stitch server is used to retrieve the initial contour image corresponding to the description word stored in the ComfyUI server, and the initial contour image is converted into a needle point set of sewing stitches, and the needle point set is converted into binary data and sent to the sewing machine device, including: Accessing the cache directory of the ComfyUI server through a preset search algorithm, and locating the corresponding initial outline image file according to the unique identifier of the descriptive word; Loading the initial contour image file, and traversing the image through a contour point extraction algorithm to identify a two-dimensional coordinate set of contour points point by point; Based on the coordinate set of contour points, an optimization sorting algorithm is used to calculate the shortest path between contour points to generate a continuous set of needle point paths; Interpolation calculation and smoothing processing are performed on the needle point path set to ensure the continuity of the stitches and the smoothness of the processing; Convert the processed needle point path set into a binary data packet in a specific format, which contains the coordinate information, connection sequence and empty movement instructions of the needle points; The binary data packet is sent to the sewing machine device through the TCP protocol to provide data support for subsequent processing.

7. The method according to claim 1, characterized in that The method comprises: performing stitch point traversal identification on the binary data by the sewing machine device to obtain needle point data that can be actually processed by the machine, and using the sewing machine device to execute the needle point data, including: The sewing machine device receives the binary data packet sent by the stitch server, parses the binary data through the built-in decoding module, and extracts the stitch point information including the needle point coordinates, connection sequence and idle shift instructions; Traversing the stitch point information point by point, rebuilding the stitch path according to the connection sequence of the needle points, and performing path jumps on the areas where there are empty shift instructions to ensure error-free connection during the processing; Call the path planning module inside the equipment to fine-tune the needle point path according to the characteristics of the processing material and the pin density requirements, and generate the final needle point data suitable for equipment processing; The final needle point data is loaded into the processing control module of the equipment to automatically adjust the sewing machine's working parameters, including stitch speed, tension control and path execution speed, to ensure that the sewing effect meets expectations; The sewing machine device performs processing operations according to the final needle point data, sewing the content corresponding to the description word onto the target material, and at the same time detects the needle point accuracy and stitch continuity during the processing through the built-in real-time monitoring module of the device.

8. A device for generating sewing processing graphic files by text description, characterized in that: include: The first unit is used to obtain the description word input by the user through the sewing machine device, and perform verification processing on the description word to obtain the semantic accuracy of the description word, and when the semantic accuracy of the description word is higher than a first threshold, convert the description word into an initial data packet and send it to the stitch server; The second unit is used to parse the initial data packet using the thread trace server, filter and combine the workflow data corresponding to the initial data packet from a plurality of preset workflow parameters, integrate the workflow data and the initial data packet into workflow data in a preset format, and send the workflow data to the ComfyUI server; The third unit is used to parse the workflow data using the ComfyUI server, and perform data processing according to the parsing result to obtain and store the initial contour image corresponding to the description word; The fourth unit is used to use the stitch server to retrieve the initial contour image corresponding to the description word stored in the ComfyUI server, convert the initial contour image into a needle point set of sewing stitches, convert the needle point set into binary data and send it to the sewing machine device; The fifth unit is used to perform stitch point traversal identification on the binary data through the sewing machine device to obtain needle point data that can be actually processed by the machine, and to execute the needle point data using the sewing machine device.

9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Embroidery data generating apparatus and computer-readable medium storing embroidery data generating program

    US20100228383A1

  • Multimodal semantic analysis and image retrieval

    US20240354336A1