AI image generation method and system of Photoshop-embedded plug-in
By embedding a plugin into Photoshop and combining it with key management and user binding tracking modules, the problems of cumbersome platform switching, resource abuse, and security risks when using AI image generation technology in Photoshop are solved. This enables precise resource control and operation traceability, improving design efficiency and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-03-24
AI Technical Summary
Existing AI image generation technologies used in Photoshop suffer from problems such as cumbersome platform switching, resource abuse, security risks, and management difficulties, lacking refined control and traceability mechanisms.
A plugin for Photoshop is provided, which combines a key management module, a LAVIE PS plugin module, a user binding tracking module, and a cloud-based AI image generation service module to achieve precise resource control, operation traceability, and enhanced security. The above problems are solved through AES-256 encryption and a full-link logging system.
It enables a seamless workflow between design and generation, improves creative efficiency, prevents resource abuse, ensures security, and facilitates commercial management and operational traceability.
Smart Images

Figure CN121723488A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of AI image generation and design tool integration technology, and particularly relates to an AI image generation method and system that embeds a plugin into Photoshop. Background Technology
[0002] Currently, AI image generation technologies (such as Stable Diffusion and DALL-E) are developing rapidly, but their services are mostly in the form of standalone web applications or desktop programs. When professional designers are creating works using Photoshop, if they need to generate materials using AI, they must frequently switch between different platforms, download, and then import them again. This cumbersome and interrupted process seriously affects design efficiency and creative continuity.
[0003] Furthermore, existing AI image generation services have significant shortcomings in commercial operation:
[0004] 1) The common practice of using an account system or unlimited subscriptions lacks refined usage control, which can easily lead to resource abuse and high operating costs for service providers.
[0005] 2) The inability to accurately record and track specific user generation behaviors (such as generation time, parameters, and results) leads to difficulties in service auditing, ambiguity in responsibility attribution, and is detrimental to enterprise-level management.
[0006] 3) Access credentials (such as API keys) are easily shared or stolen, and lack effective binding and verification mechanisms, posing security risks.
[0007] Therefore, there is an urgent need in this field for an AI image generation solution that can be deeply integrated into professional design software while addressing issues of resource management, operational traceability, and security risks. Summary of the Invention
[0008] The purpose of this invention is to provide an AI image generation method and system that embeds a plugin into Photoshop, in order to solve the technical problem.
[0009] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:
[0010] In some embodiments of this application, an AI image generation method and system with an embedded Photoshop plugin is provided, including:
[0011] The key management module is used to generate and manage access keys with a fixed AI image generation resource quota;
[0012] The LAVIE PS plugin module, embedded within Adobe Photoshop software, is used to receive and verify the access key entered by the user, set image generation parameters, send generation requests to the cloud, and receive and load the generated image returned from the cloud.
[0013] The user binding tracking module is used to establish and store the mapping relationship between user accounts and access keys, and to record detailed usage logs of the access keys;
[0014] The cloud-based AI image generation service module is used to receive verified and valid generation requests from the LAVIE PS plugin module, execute AI image generation tasks, and return the generated image data.
[0015] In some embodiments of this application, the key management module uses the AES-256 encryption algorithm to generate and manage the access key, and monitors the validity status of the key throughout its entire lifecycle.
[0016] In some embodiments of this application, the LAVIE PS plugin module associates the verification result obtained after the key verification is successful with the image generation parameters set by the user, and encapsulates them into the same data packet and sends them to the cloud AI image generation service module.
[0017] In some embodiments of this application, the detailed usage log recorded by the user binding tracking module includes at least: image generation timestamp, input generation efficiency parameters, storage identifier of the generation result, and remaining resource quota after the usage.
[0018] In some embodiments of this application, the cloud-based AI image generation service module has a built-in AI image generation model based on Stable Diffusion.
[0019] Some embodiments of this application include the following steps:
[0020] S1: Key distribution and binding steps: Distribute a unique access key to the designated user and bind the key to the user account;
[0021] S2: Plugin verification step: The user enters the access key through the LAVIE PS plugin module in Photoshop. The plugin module initiates verification to the key management module and obtains the verification result and remaining quota.
[0022] S3: Request generation and sending steps: The user sets the image generation parameters in the plugin module, and the plugin module sends the verification result and the generation parameters to the cloud AI image generation service module.
[0023] S4: Cloud generation and feedback steps: After confirming that the request is valid, the cloud AI image generation service module calls the AI model to generate an image and returns the result to the LAVIE PS plugin module;
[0024] S5: Result Loading and Recording Steps: The LAVIE PS plugin module loads the received image into the Photoshop canvas. At the same time, the user binding tracking module updates the remaining quota of the access key and records the usage log generated this time.
[0025] In some embodiments of this application, in step S2, after the key verification is successful, the LAVIE PS plugin module displays the remaining resource quota of the access key in real time in the user interface, and sends a prompt message to the user when the quota is exhausted.
[0026] In some embodiments of this application, the image generation parameters in step S3 include at least: style description, resolution specifications, and text prompts.
[0027] Compared with existing technologies, the beneficial effects of this invention are as follows: By seamlessly embedding the AI image generation function into Photoshop as a plugin, this invention achieves a closed-loop workflow between design and generation, greatly improving creative efficiency; through the binding mechanism of keys and fixed quotas, it achieves precise control of resources, effectively preventing abuse and providing a foundation for commercial operation; by establishing a full-link log system of "user-key-operation," it ensures the traceability of every generation behavior, facilitating auditing and management; at the same time, the key management scheme based on strong binding and encryption technology fundamentally eliminates the risk of credential sharing and theft, significantly improving service security. Attached Figure Description
[0028] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0029] Figure 1 This is a schematic diagram of the system interface provided in an embodiment of the present invention. Detailed Implementation
[0030] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0031] To better understand the purpose, structure, and function of this invention, the invention will be described in further detail below with reference to the accompanying drawings.
[0032] The preferred embodiments of the AI image generation system and method embedded in Photoshop provided by the present invention will be described in detail below with reference to the accompanying drawings. Those skilled in the art will understand that the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0033] I. System Hardware and Software Environment Configuration
[0034] The implementation of this system depends on a specific hardware and software infrastructure.
[0035] Server environment:
[0036] Servers: One or more Alibaba Cloud ECS (Elastic Compute Service) instances are used. The key management module and user binding tracking module are deployed on general-purpose computing instances (such as ecs.g6.large) configured with an internal network firewall to ensure data security. The cloud-based AI image generation service module is deployed on GPU computing instances equipped with NVIDIA Tesla T4 or V100 GPUs (such as ecs.gn6i-c4g1.xlarge) to accelerate model inference.
[0037] Operating System: All servers use Ubuntu 18.04LTS or a later version of Linux operating system.
[0038] Database: The user binding tracking module uses a relational database of MySQL 5.7 or later to persistently store user information, key mapping relationships, and usage logs.
[0039] Client environment:
[0040] Design software: Adobe Photoshop CC 2020 or later needs to be installed on the user's device.
[0041] Plugin Environment: The LAVIE PS plugin module is developed based on the Adobe Photoshop SDK (CEP extension) and supports Photoshop's extension framework. Users deploy it by installing the packaged .zxp plugin file.
[0042] Operating System: The client supports Windows 10 and above or macOS 10.14 and above.
[0043] Network: The client needs a stable internet connection in order to communicate with the cloud service via HTTPS.
[0044] II. Detailed Implementation of the System Core Modules
[0045] This system consists of four modules that work together.
[0046] Implementation of the key management module:
[0047] This module is developed using the Java Spring Boot framework and provides a RESTful API interface.
[0048] Key Generation: When an administrator creates a new key through the backend, the system calls the SecureRandom class of Java CryptographyArchitecture (JCA) to generate a 16-byte strong random number as a seed. Then, it uses the AES-256 encryption algorithm (GCM mode) to generate a unique 16-character string consisting of uppercase letters and numbers, i.e., "BANANA key" (e.g., BNK20250001-ABCD1234). Before this key is stored in the database, its associated initial resource quota (e.g., 1000 uses) and status ("inactive", "activated", "used up", "expired") are recorded.
[0049] Key Verification: When the LAVIE plugin sends a verification request, this API receives the key string, first queries the encrypted database to verify its existence, whether its status is "activated," and whether the remaining quota is greater than 0. The verification result (success / failure and remaining quota) is returned in JSON format, for example: {"status":"success","remaining_quota":1000}.
[0050] Implementation of the LAVIE PS plugin module: This module is developed using front-end technologies (HTML5, CSS3, JavaScript) in conjunction with the CEP SDK.
[0052] Interface composition:
[0053] Key input area: contains a text input box and a "Verify" button.
[0054] Status display area: Used to display "Verification successful / failed" prompts and "Remaining quota: XXX cards".
[0055] Parameter setting area:
[0056] "Prompt word" text box ( <textarea> This is used to receive user descriptions of the image content.< / textarea>
[0057] "Style" dropdown selection box ( <select> ), providing preset styles such as "watercolor", "oil painting", "science fiction", and "realism".
[0058] "Resolution" input box (< / select> <input type="number">) allows the user to input the width and height, such as 1920x1080.
[0059] Generation control area: A "Generate" button and a progress bar for displaying the generation progress.
[0060] Core logic:
[0061] After the user clicks the "Verify" button, the plugin uses the evalScript() method of CSInterface (provided by the CEP SDK) to call the ExtendScript script inside Photoshop, and this script then发起 a request to the verification interface of the key management module through the HTTP fetch API.
[0062] After successful verification, the plugin temporarily stores the received "verification passed token" (token) and the parameters set by the user in the interface (formatted as JSON, such as {"prompt": "a cat", "style": "watercolor", "width": 1920, "height": 1080}) in memory.
[0063] When the user clicks the "Generate" button, the plugin sends the above temporarily stored token and the parameter JSON to the API endpoint of the cloud AI image generation service module.
[0064] The plugin asynchronously waits for the response and displays the progress bar during this period. After receiving the image data (usually a Base64-encoded PNG or JPG file), it again calls the DOM (Document Object Model) of Photoshop through the ExtendScript script to create a new document or a new layer and load the image data.
[0065] Implementation of the user binding tracking module:
[0066] This module is developed using the Python Django framework and provides a simple Web management background.
[0067] Data table design: Create the main data tables in MySQL:
[0068] users table: The fields include user_id (primary key), username, create_time.
[0069] banana_keys table: The fields include key_string (primary key), user_id (foreign key), total_quota, remaining_quota, status.
[0070] The usage_logs table has fields including log_id (auto-incrementing primary key), key_string, user_id, timestamp, prompt_text, style, resolution, generated_image_url (or file hash), and quota_used (default is 1).
[0071] Log Recording: After the cloud AI service completes image generation, it synchronously calls another RESTful API provided by this module, passing in the key_string of this task and the generation parameters. The controller of this module will then insert a new record into the usage_logs table and execute an SQL update statement (UPDATE banana_keys SETremaining_quota=remaining_quota-1WHERE key_string=?) to deduct the quota.
[0072] Implementation of the cloud-based AI image generation service module:
[0073] This module is developed using the Python Flask or FastAPI framework to fully leverage its AI ecosystem.
[0074] Model loading: When the service starts, the pre-trained StableDiffusion v1.5 or SDXL model is loaded into GPU memory using the torch and diffuses libraries.
[0075] Request processing:
[0076] Provide a POST request interface for / generate.
[0077] After receiving a request from the plugin, the interface first extracts the "verification pass token" from the request header or body, and then initiates a fast secondary verification to the key management module (to ensure that the key has not been exhausted or revoked after the request was sent).
[0078] After the second verification passes, the service concatenates the prompt and style parameters in the JSON parameters into the final prompt word (e.g., "a watercolor painting of a cat"), and sets the size of the generated image according to the resolution parameter.
[0079] The pipe(prompt=final_prompt,height=height,width=width).images[0] method of the Stable Diffusion model is called for inference.
[0080] Once generated, the PIL image object is converted into a byte stream and then lossless compressed.
[0081] Response and Callback: The compressed image byte stream is returned to the LAVIE plugin as an HTTP response body. Simultaneously, the logging API of the user-bound tracking module is asynchronously invoked (e.g., using a Celery task queue) to submit the generated record.
[0082] III. Detailed Implementation Examples of System Workflow
[0083] Take a complete user scenario as an example:
[0084] Preparation Phase: The administrator logs into the web backend of the user binding tracking module and adds a new user named "Wang Wu" with the username "WW001" in "User Management". Then, in "Key Management", the administrator clicks "Generate New Key", and the system automatically generates a key (e.g., BNK20250003-IJKL9012) and binds it to "WW001". The administrator then informs user Wang Wu of the key string.
[0085] Generation phase:
[0086] Wang Wu launched the installed LAVIE PS plugin in his Photoshop.
[0087] He entered BNK20250003-IJKL9012 in the plugin's key input box and clicked "Verify". The plugin interface displayed "Verification successful, remaining quota: 1000 cards".
[0088] He entered the prompt "windmills under the setting sun, golden wheat fields, impressionist style" in the parameter settings area and selected the resolution "1920x1080".
[0089] He clicked the "Generate" button.
[0090] The plugin sends a request to the ` / generate` interface of the cloud AI service. The cloud service performs secondary verification and starts the Stable Diffusion model for generation, which takes approximately 25 seconds.
[0091] Once generated, the image data is returned to the plugin, which automatically creates a new 1920x1080 document in Photoshop and places the generated image within it.
[0092] Almost simultaneously, a new log entry was inserted into the database of the user binding tracking module: (key_string:'BNK20250003-IJKL9012',user_id:'WW001',prompt_text:'Windmills under the setting sun, golden wheat fields, Impressionist style',...,remaining_quota:999).
[0093] Traceability Phase: Administrators can view all detailed information about the generation, including the generation time and the specific prompt words used, by filtering the user "Wang Wu" or the key BNK20250003-IJKL9012 on the "Usage Log" page in the Web backend, thus achieving complete traceability of the operation.
[0094] IV. Preferred Embodiments and Variations
[0095] The above description is merely a preferred embodiment of the present invention. Those skilled in the art can make various modifications and substitutions without departing from the principles of the present invention.
[0096] For example, the AI generative model is not limited to Stable Diffusion, but can also be replaced by DALL-E, Midjourney API, or other generative models based on GAN or autoregressive models.
[0097] For example, the format and encryption method of the key can be adjusted, and the resource quota can also be set to be dynamically consumed based on the total number of pixels of the generated image or the calculation time.
[0098] For example, the LAVIE plugin module can also integrate more advanced AI editing functions such as image inpainting and image outpainting. Its implementation principle is similar to that of text-to-image generation in this embodiment, and both should be included within the scope of protection of this invention.
[0099] In the description of this application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0100] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0101] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0102] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0103] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An AI image generation system embedded in Photoshop, characterized in that, include: The key management module is used to generate and manage access keys with a fixed AI image generation resource quota; The LAVIE PS plugin module, embedded within Adobe Photoshop software, is used to receive and verify the access key entered by the user, set image generation parameters, send generation requests to the cloud, and receive and load the generated image returned from the cloud. The user binding tracking module is used to establish and store the mapping relationship between user accounts and access keys, and to record detailed usage logs of the access keys; The cloud-based AI image generation service module is used to receive verified and valid generation requests from the LAVIE PS plugin module, execute AI image generation tasks, and return the generated image data.
2. The system according to claim 1, characterized in that, The key management module uses the AES-256 encryption algorithm to generate and manage the access key, and monitors the validity status of the key throughout its entire lifecycle.
3. The system according to claim 1, characterized in that, The LAVIE PS plugin module associates the verification result obtained after the key verification is successful with the image generation parameters set by the user, and encapsulates them into the same data packet and sends them to the cloud AI image generation service module.
4. The system according to claim 1, characterized in that, The detailed usage log recorded by the user binding tracking module includes at least: image generation timestamp, input generation efficiency parameters, storage identifier of the generation result, and remaining resource quota after this use.
5. The system according to claim 1, characterized in that, The cloud-based AI image generation service module has a built-in AI image generation model based on Stable Diffusion.
6. An AI image generation method based on the system of any one of claims 1 to 5, characterized in that, Includes the following steps: S1: Key distribution and binding steps: Distribute a unique access key to the designated user and bind the key to the user account; S2: Plugin verification step: The user enters the access key through the LAVIE PS plugin module in Photoshop. The plugin module initiates verification to the key management module and obtains the verification result and remaining quota. S3: Request generation and sending steps: The user sets the image generation parameters in the plugin module, and the plugin module sends the verification result and the generation parameters to the cloud AI image generation service module. S4: Cloud generation and feedback steps: After confirming that the request is valid, the cloud AI image generation service module calls the AI model to generate an image and returns the result to the LAVIE PS plugin module; S5: Result Loading and Recording Steps: The LAVIE PS plugin module loads the received image into the Photoshop canvas. At the same time, the user binding tracking module updates the remaining quota of the access key and records the usage log generated this time.
7. The method according to claim 6, characterized in that, In step S2, after the key verification is successful, the LAVIE PS plugin module displays the remaining resource quota of the access key in real time in the user interface, and sends a prompt message to the user when the quota is exhausted.
8. The method according to claim 6, characterized in that, In step S3, the image generation parameters include at least: style description, resolution specifications, and text prompts.