A subway room layout intelligent design method based on stable diffusion

By using a Stable Diffusion-based intelligent design method for subway room layouts, and training ControlNet and LoRA models, subway room layout diagrams that conform to standards are automatically generated. This solves the problems of high repetition and poor reusability in traditional design, and improves design efficiency and resource utilization.

CN120930230BActive Publication Date: 2026-07-03HARBIN INST OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN INST OF TECH
Filing Date
2025-07-30
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Traditional subway station layout design suffers from repetitive work, low design efficiency, and poor reusability of design drawings, resulting in high time costs and waste of valuable data.

Method used

A smart design method for subway room layout based on Stable Diffusion is adopted. By extracting features and generating a spatial division heatmap through a region growing algorithm, and training it with ControlNet and LoRA models, the method realizes the mapping from abstract layout to specific outline, performs detailed optimization, and finally generates a spatial layout map that meets the design requirements.

Benefits of technology

It significantly reduces manual drafting work, improves design efficiency, saves computing resources and time, and generates design drawings that not only meet spatial layout and area requirements but also satisfy the detailed specifications of professional drawings, making them suitable for subsequent design processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930230B_ABST
    Figure CN120930230B_ABST
Patent Text Reader

Abstract

The application provides a subway room layout intelligent design method based on Stable Diffusion. The method comprises the following steps: feature extraction is performed on multiple types of plan drawings of actual projects, a space division heat map is generated based on a room center point by using a region growing algorithm, and a heat map-layout sketch pairing data set is constructed; a two-stage training strategy is adopted, a ControlNet model is first trained to learn space constraint relationships, and then LoRA is trained for efficient parameter fine-tuning; according to design requirements, a room proxy point is set to generate a heat map by using a region growing algorithm, and a trained ControlNet model is combined with LoRA to realize accurate translation from the heat map to the layout map. The application innovatively combines the conditional control ability of ControlNet and the efficient parameter fine-tuning advantage of LoRA, significantly reduces the demand for computing resources while ensuring the generation quality, and improves the design efficiency and resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of civil engineering technology, and in particular to a smart design method for subway room layout based on Stable Diffusion. Background Technology

[0002] With the rapid advancement of urbanization in my country, the scale of rail transit construction has continued to expand, and its network structure has gradually evolved from the initial single lines to a complex grid pattern. At the same time, the rapid development of artificial intelligence technology is profoundly reshaping the landscape of many industries, driving a wave of intelligent upgrading. Against this backdrop, concepts such as "intelligent transportation" and "intelligent construction" have emerged, and intelligent innovation has become a core trend for future development.

[0003] Focusing on the field of rail transit engineering design, traditional station layout drawing design methods often face significant challenges: a large amount of repetitive work leads to high time costs and low design efficiency; at the same time, the generated design drawings have poor reusability, resulting in the waste of valuable data. To address these issues, introducing artificial intelligence technologies such as Stable Diffusion to assist in the intelligent layout design of subway station rooms will effectively improve the level of design automation, significantly shorten the design cycle, and promote the reuse of design results, providing a new path for the intelligent construction of rail transit. Summary of the Invention

[0004] The purpose of this invention is to address the problems in existing technologies by proposing a smart design method for subway room layouts based on Stable Diffusion. This method is applicable to the intelligent design of subway room locations.

[0005] This invention is achieved through the following technical solution: This invention proposes a smart design method for subway room layout based on Stable Diffusion, the method comprising:

[0006] Step 1: Extract features from the subway station floor plan, generate a spatial partitioning heatmap based on the center points of each room using a region growing algorithm, and construct a dataset by combining it with a simplified spatial layout diagram.

[0007] Step 2: Based on a pre-trained, parameter-locked Stable Diffusion base model, the ControlNet model is trained using the pairwise dataset constructed in Step 1. During training, heatmaps are used as conditional inputs and spatial layout sketches are used as outputs, enabling ControlNet to learn the mapping relationship from regional color block layouts to specific room outlines. To achieve detailed optimization, the LoRA model is trained using the layout sketch dataset. By injecting trainable low-rank matrices into the attention layer weights of the Stable Diffusion model, the model is efficiently fine-tuned to learn the translation task while freezing most of the original model parameters.

[0008] Step 3: Based on the new design requirements and specifications, set the room proxy points and areas, and generate a new control image using a region growing algorithm; input the control image into the StableDiffusion model equipped with the ControlNet model trained in Step 2 to generate a preliminary layout diagram containing accurate spatial structure; using the preliminary layout diagram as input, in the Stable Diffusion graph generation process, load and apply the LoRA model weights trained in Step 2 to fine-tune the preliminary layout diagram, and finally generate a simplified spatial layout diagram that meets the design requirements.

[0009] Furthermore, in step one, a drawing library and layout sketch dataset are constructed: a large number of subway station floor plans from actual projects are collected and organized to form an original drawing library; each drawing in the library is digitized and simplified, removing non-structural details and retaining only the walls, doorways and outlines that can express the core spatial division, forming a spatial layout sketch that corresponds one-to-one with the original drawing; this batch of sketches constitutes the target output dataset required for subsequent model training.

[0010] Extract room proxy points and area information: Extract features from the original drawings in the drawing library, accurately record the center point coordinates of each functional room as proxy points, and calculate its design area.

[0011] Further, in step one, based on the extracted proxy points and area information, a spatial partitioning heatmap is generated using a region growing algorithm. The specific method is as follows: the overall outline space of the station is divided into unit grid regions, the Euclidean distance from the center of each grid to all proxy points is calculated, and the grid is initially assigned to the room represented by the nearest proxy point; a unique color or pixel value is assigned to each room type and colored; during the growing process, the grid area allocated to each room is accumulated in real time, and the growing of that room is stopped when the area of ​​a room reaches the extracted design area; all proxy points are traversed until the entire station outline space is completely partitioned and colored, forming a color heatmap representing the spatial topology and area allocation.

[0012] Furthermore, a pairwise training dataset is constructed: each generated heatmap is paired with its corresponding spatial layout sketch to form a pairwise dataset in the format of "(condition, target)", which is used for the supervised training of the ControlNet model.

[0013] Furthermore, the training of the ControlNet model is specifically as follows:

[0014] a) Initialization and Locking: Load a Stable Diffusion base model that has been pre-trained on billions of images; the core of this model is a noise prediction network based on the U-Net architecture; set all parameters of this base model to an untrainable state, i.e., "frozen" or "locked";

[0015] b) Construct the ControlNet structure: Copy all encoder modules and intermediate modules in the locked Stable Diffusion U-Net model to create a copy with the same structure but trainable parameters; connect the output of the trainable copy to the input of the corresponding module in the locked U-Net through a "zero convolutional layer";

[0016] c) Training process: Train using the paired datasets constructed in step one; during training, use the heatmap as a control condition. The image is then input into ControlNet; the corresponding spatial layout diagram is used as the target image, and the StableDiffusion encoder is used to convert it into a low-dimensional latent space representation. In latent space Apply different time steps Gaussian noise, to obtain The training objective is to enable the entire system equipped with ControlNet to respond to input... Time step and conditional heatmap It accurately predicts the added noise. The model's loss function is the mean squared error between the predicted noise and the actual noise.

[0017]

[0018] By using the backpropagation algorithm, only the parameters of the trainable copy of ControlNet and the zero convolutional layer are updated; this process enables ControlNet to learn the mapping relationship from the abstract area color block layout to the precise room outline lines.

[0019] Furthermore, the training of the LoRA model is specifically as follows:

[0020] a) Initialization and Freezing: To enable fine-tuning of the generated results, load the pre-trained StableDiffusion base model and freeze all its parameters;

[0021] b) Injecting a low-rank matrix: A trainable low-rank adaptive LoRA module is injected into the weight matrix of the attention layer in the Stable Diffusion model U-Net architecture; specifically, for an original weight matrix... Its update volume It is decomposed into the product of two low-rank matrices. ,Right now

[0022]

[0023] c) Fine-tuning training: Using a partial spatial layout simplified dataset that does not require heatmaps, fine-tune the training on low-rank matrices A and B in the LoRA module.

[0024] Furthermore, the generation of the preliminary layout diagram specifically includes:

[0025] a) Create a new control heatmap: Based on the new project requirements and relevant design specifications, designers set new room agent points and their required areas in the design software, and use the region growing algorithm to generate a brand new control heatmap.

[0026] b) Conditional Image Generation: This control heatmap is input into a trained StableDiffusion model equipped with ControlNet; the StableDiffusion model generates a random latent space noise vector. Initially, guided precisely by ControlNet, noise is gradually removed through a multi-step reverse diffusion process, ultimately generating a clean latent space representation. ;

[0027] c) Decoding output: Representing the latent space The Stable Diffusion decoder restores the pixel space, thereby generating a preliminary layout map that strictly follows the spatial structure requirements of the input heatmap.

[0028] Furthermore, the fine-tuning to generate the final layout diagram specifically involves:

[0029] a) Loading LoRA weights and graph-generating settings: The generated preliminary layout map serves as the input image for the Stable Diffusion graph-generating process; the trained LoRA model weights are loaded and applied, and these weights are merged with the attention layer weights of the base model through matrix addition;

[0030] b) Fine-tuning: The initial layout of the input is encoded into the latent space and a small amount of noise is added. Then, the model with LoRA weights is back-diffused onto the noisy latent space representation.

[0031] c) Final output: The finely tuned latent space representation is restored to pixel space through the decoder, and a simplified spatial layout diagram is finally generated that meets the spatial layout requirements of the new design and conforms to the specific drawing specifications in detail.

[0032] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the intelligent design method for subway room layout based on Stable Diffusion.

[0033] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the aforementioned intelligent design method for subway room layout based on Stable Diffusion.

[0034] The beneficial effects of this invention are:

[0035] 1. This invention proposes a smart design method for subway room layout based on Stable Diffusion, which can automatically generate a subway room layout diagram that conforms to the specifications based on simple user input (room location and area), greatly reducing manual drawing work and improving design efficiency.

[0036] 2. This invention makes full use of existing design drawings to construct training data and performs lightweight fine-tuning based on powerful pre-trained models (ControlNet and LoRA), which greatly saves the computing resources and time required for training and avoids repetitive work.

[0037] 3. The generated design drawings strictly adhere to the spatial layout and area requirements (accurate overall structure) and meet the detailed specifications of professional drawings. The output results can be directly used in subsequent design processes. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0039] Figure 1 This is a flowchart of a smart design method for subway room layout based on Stable Diffusion, as described in this invention.

[0040] Figure 2 This is a schematic diagram of a heatmap generated from a simplified map with surrogate points and an outer contour through region growth.

[0041] Figure 3 This is a schematic diagram illustrating the training principle of the ControlNet model.

[0042] Figure 4 This is a schematic diagram illustrating the LoRA training principle.

[0043] Figure 5 This is a schematic diagram of the ControlNet and LoRA collaborative framework. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0045] This invention proposes an intelligent design method for subway room layout based on Stable Diffusion, comprising the following steps: feature extraction from various types of floor plans of actual projects; generation of spatial partitioning heatmaps based on room center points using a region growing algorithm; simplification of the floor plans to obtain simplified spatial layout diagrams; and construction of a heatmap-layout diagram pairing dataset. A two-stage training strategy is adopted: first, a ControlNet model is trained to learn spatial constraint relationships; conditional control is applied to the pre-trained Stable Diffusion model; then, LoRA (Low-Rank Adaptive) is trained for efficient parameter fine-tuning. Room proxy points are set according to design requirements, and heatmaps are generated using the region growing algorithm. The trained ControlNet model, combined with LoRA, achieves accurate translation from heatmaps to layout diagrams. This invention innovatively integrates the conditional control capabilities of ControlNet and the efficient parameter fine-tuning advantages of LoRA, significantly reducing computational resource requirements while ensuring generation quality, improving design efficiency and resource utilization, and providing an intelligent solution for subway space design.

[0046] Specifically, in combination Figures 1-5 This invention proposes a smart design method for subway room layout based on Stable Diffusion, the method comprising the following specific steps:

[0047] Step 1: Extract features from the subway station floor plan, generate a spatial partitioning heatmap based on the center points of each room using a region growing algorithm, and construct a dataset by combining it with a simplified spatial layout diagram.

[0048] Step 2: Based on a pre-trained, parameter-locked Stable Diffusion base model, the ControlNet model is trained using the pairwise dataset constructed in Step 1. During training, heatmaps are used as conditional inputs and spatial layout sketches as outputs, enabling ControlNet to learn the mapping relationship from regional color block layouts to specific room outlines. To achieve specific detail optimizations, a LoRA (low-rank adaptation) model is trained using a partial layout sketch dataset. By injecting trainable low-rank matrices into the attention layer weights of the Stable Diffusion model, the model is efficiently fine-tuned to learn specific translation tasks while freezing most of the original model parameters.

[0049] Step 3: Based on the new design requirements and specifications, set the room proxy points and areas, and generate a new control image (i.e., heatmap) using a region growing algorithm. Input this control image into the Stable Diffusion system equipped with the ControlNet model trained in Step 2 to generate a preliminary layout diagram containing accurate spatial structure. Using this preliminary layout diagram as input, in the Stable Diffusion's image-to-image (img2img) workflow, load and apply the LoRA model weights trained in Step 2 to fine-tune the preliminary layout diagram, ultimately generating a simplified spatial layout diagram that meets the design requirements.

[0050] Step one specifically involves:

[0051] Step 1.1: Construct a drawing library and layout sketch dataset. Collect and organize a large number of actual subway station floor plans to form an initial drawing library. Digitize and simplify each drawing in the library, removing non-structural details such as dimensions, text descriptions, furniture, and pipelines, retaining only walls, doorways, and outlines that express the core spatial divisions, creating simplified spatial layout sketches that correspond one-to-one with the original drawings. This batch of simplified sketches constitutes the target output (Ground Truth) dataset required for subsequent model training.

[0052] Step 1.2: Extract room agent point and area information. Extract features from the original drawings in the drawing library, accurately record the center point coordinates of each functional room (such as equipment room, management room, public area, etc.) as agent points, and calculate their design area.

[0053] Step 1.3: Generate a spatial partitioning heatmap. Based on the surrogate point and area information extracted in Step 1.2, a spatial partitioning heatmap is generated using a Region Growing Algorithm. Specifically, the overall station outline space is divided into unit grid regions. The Euclidean distance from the center of each grid to all surrogate points is calculated, and the grid is initially assigned to the room represented by the nearest surrogate point. A unique color or pixel value is assigned to each room type, and the room is colored. During the growth process, the assigned grid area for each room is accumulated in real time. When the area of ​​a room reaches the design area extracted in Step 1.2, the growth of that room is stopped. All surrogate points are traversed until the entire station outline space is completely partitioned and colored, forming a color heatmap representing the spatial topology and area allocation.

[0054] Step 1.4: Construct a pairwise training dataset. Pair each heatmap generated in Step 1.3 with the corresponding spatial layout sketch generated in Step 1.1 to construct a pairwise dataset in the format of "(condition, target)" for subsequent supervised training of the ControlNet model.

[0055] Step two specifically involves:

[0056] Step 2.1: Training the ControlNet model.

[0057] a) Initialization and Locking: Load a Stable Diffusion base model that has been pre-trained on billions of images. The core of this model is a noise prediction network based on the U-Net architecture. To preserve its powerful prior knowledge of image generation, all parameters of this base model are set to an untrainable state (i.e., "frozen" or "locked").

[0058] b) Constructing the ControlNet structure: All encoder blocks and middle blocks in the locked Stable Diffusion U-Net model are copied to create a structurally identical but trainable copy. The output of the trainable copy is connected to the input of the corresponding block in the locked U-Net via a "zero convolution" (a 1x1 convolutional layer with weights and biases initialized to zero). This design ensures that the trainable copy does not introduce any harmful noise into the locked backbone network during the early stages of training, thus guaranteeing training stability.

[0059] c) Training process: Training is performed using the paired datasets constructed in step one. During training, the heatmap is used as a control condition. This is then input into ControlNet. The corresponding spatial layout diagram is used as the target image, and the StableDiffusion encoder is used to convert it into a low-dimensional latent space representation. In latent space Apply different time steps Gaussian noise, to obtain The training goal is to enable the entire system equipped with ControlNet to respond to input... Time step and conditional heatmap It accurately predicts the added noise. The model's loss function is the mean squared error between the predicted noise and the actual noise:

[0060]

[0061] Through backpropagation, only the parameters of the trainable copy of ControlNet and the zero convolutional layer are updated. This process enables ControlNet to learn the complex mapping relationship from abstract regional color block layouts (heatmaps) to precise room outlines (simplified spatial layout diagrams).

[0062] Step 2.2: Training the LoRA model.

[0063] a) Initialization and Freezing: To enable fine-tuning of the generated results, load the pre-trained StableDiffusion base model and freeze all its parameters.

[0064] b) Injecting a low-rank matrix: A trainable low-rank adaptation (LoRA) module is injected into the weight matrix of the attention layers in the Stable Diffusion model U-Net architecture. Specifically, for an original weight matrix... Its update volume It is decomposed into the product of two low-rank matrices. ,Right now

[0065]

[0066] c) Fine-tuning training: Using the partial spatial layout sketch dataset obtained in step 1.1 (no heatmap required), fine-tune the low-rank matrices A and B in the LoRA module. Since the number of trainable parameters is extremely small (only one ten-thousandth of the original model's parameters), this training process is highly efficient and requires far fewer computational resources than full-parameter fine-tuning.

[0067] Step three specifically involves:

[0068] Step 3.1: Generate a preliminary layout diagram.

[0069] a) Create a new control heatmap: Based on the new project requirements and relevant design specifications, the designers set new room agent points and their required areas in the design software, and generate a brand new control heatmap using the same area growth algorithm as in step 1.3.

[0070] b) Conditional Image Generation: Input this control heatmap into the Stable Diffusion system trained in step 2.1 and equipped with ControlNet. The system generates the heatmap from a random latent space noise vector. Initially, guided precisely by ControlNet, noise is gradually removed through a multi-step denoising process, ultimately generating a clean latent space representation. .

[0071] c) Decoding output: Representing the latent space The Stable Diffusion decoder restores the image to pixel space, thus generating a preliminary layout map that strictly follows the spatial structure requirements of the input heatmap.

[0072] Step 3.2: Fine-tune and generate the final layout diagram.

[0073] a) Loading LoRA weights and image-to-image (img2img) settings: The preliminary layout image generated in step 3.1 is used as the input image for the Stable Diffusion image-to-image pipeline. The LoRA model weights trained in step 2.2 are loaded and applied. These weights are merged with the attention layer weights of the base model through matrix addition. This process does not introduce additional inference latency.

[0074] b) Fine-tuning: The initial layout map is encoded into the latent space, and a small amount of noise is added. Then, the model with LoRA weights performs back-diffusion on the noisy latent space representation. This process fine-tunes the initial layout map because the LoRA model learns specific detail features.

[0075] c) Final output: The finely tuned latent space representation is restored to pixel space through the decoder, and a simplified spatial layout diagram is finally generated that meets the spatial layout requirements of the new design and conforms to the specific drawing specifications in detail.

[0076] The present invention also proposes an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the intelligent design method for subway room layout based on Stable Diffusion.

[0077] The present invention also proposes a computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the steps of the aforementioned intelligent design method for subway room layout based on Stable Diffusion.

[0078] The memory in this application embodiment can be volatile memory or non-volatile memory, or it can include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the methods described in this invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0079] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., high-density digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0080] In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, detailed descriptions are omitted here.

[0081] It should be noted that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied as execution by a hardware decoding processor, or as a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0082] The above provides a detailed description of the intelligent design method for subway room layout based on Stable Diffusion proposed in this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A method for intelligent design of subway room layout based on Stable Diffusion, characterized in that, The method includes: Step 1: Extract features from the subway station floor plan, generate a spatial partitioning heatmap based on the center points of each room using a region growing algorithm, and construct a dataset by combining it with a simplified spatial layout diagram. Step 2: Based on a pre-trained, parameter-locked Stable Diffusion base model, the ControlNet model is trained using the pairwise dataset constructed in Step 1. During training, heatmaps are used as conditional inputs and spatial layout sketches are used as outputs, enabling ControlNet to learn the mapping relationship from regional color block layouts to specific room outlines. To achieve detailed optimization, the LoRA model is trained using the layout sketch dataset. By injecting trainable low-rank matrices into the attention layer weights of the Stable Diffusion model, the model is efficiently fine-tuned to learn the translation task while freezing most of the original model parameters. Step 3: Based on the new design requirements and specifications, set the room proxy points and areas, and generate a new control image using the region growing algorithm; input the control image into the StableDiffusion model equipped with the ControlNet model trained in Step 2 to generate a preliminary layout diagram containing accurate spatial structure; use the preliminary layout diagram as input, load and apply the LoRA model weights trained in Step 2 in the Stable Diffusion graph generation process, fine-tune the preliminary layout diagram, and finally generate a simplified spatial layout diagram that meets the design requirements; The training of the LoRA model is specifically as follows: a) Initialization and Freezing: To enable fine-tuning of the generated results, load the pre-trained Stable Diffusion base model and freeze all its parameters; b) Injecting a low-rank matrix: A trainable low-rank adaptive LoRA module is injected into the weight matrix of the attention layer in the Stable Diffusion model U-Net architecture; specifically, for an original weight matrix... Its update volume It is decomposed into the product of two low-rank matrices. ,Right now c) Fine-tuning training: Using a partial spatial layout simplified dataset, which does not require heatmaps, fine-tun the training on low-rank matrices A and B in the LoRA module. The fine-tuning process to generate the final layout diagram specifically involves: a) Load LoRA weights and graph-generated image settings: The generated preliminary layout image serves as the input image for the Stable Diffusion graph-generated image pipeline; Load and apply the trained LoRA model weights, which are merged with the attention layer weights of the base model through matrix addition; b) Fine-tuning: The initial layout of the input is encoded into the latent space and a small amount of noise is added. Then, the model with LoRA weights is back-diffused onto the noisy latent space representation. c) Final output: The finely tuned latent space representation is restored to pixel space through the decoder, and a simplified spatial layout diagram is finally generated that meets the spatial layout requirements of the new design and conforms to the specific drawing specifications in detail.

2. The method according to claim 1, characterized in that, In step one, a drawing library and layout sketch dataset are constructed: a large number of subway station floor plans from actual projects are collected and organized to form an original drawing library; each drawing in the library is digitized and simplified, removing non-structural details and retaining only the walls, doorways and outlines that can express the core space division, forming a spatial layout sketch that corresponds one-to-one with the original drawing; this batch of sketches constitutes the target output dataset required for subsequent model training. Extract room proxy points and area information: Extract features from the original drawings in the drawing library, accurately record the center point coordinates of each functional room as proxy points, and calculate its design area.

3. The method according to claim 2, characterized in that, In step one, based on the extracted proxy points and area information, a spatial partitioning heatmap is generated using a region growing algorithm. Specifically, the overall outline space of the station is divided into unit grid regions. The Euclidean distance from the center of each grid to all proxy points is calculated, and the grid is initially assigned to the room represented by the nearest proxy point. A unique color or pixel value is assigned to each room type, and the room is colored. During the growing process, the grid area allocated to each room is accumulated in real time. When the area of ​​a room reaches the extracted design area, the growth of that room is stopped. All proxy points are traversed until the entire station outline space is completely partitioned and colored, forming a color heatmap representing the spatial topology and area allocation.

4. The method according to claim 3, characterized in that, Constructing a pairwise training dataset: Each generated heatmap is paired with its corresponding spatial layout sketch to form a pairwise dataset in the format of "(condition, target)" for subsequent supervised training of the ControlNet model.

5. The method according to claim 4, characterized in that, The training of the ControlNet model is specifically as follows: a) Initialization and Locking: Load a Stable Diffusion base model that has been pre-trained on billions of images; the core of this model is a noise prediction network based on the U-Net architecture; set all parameters of this base model to an untrainable state, i.e., "frozen" or "locked"; b) Construct the ControlNet structure: Copy all encoder modules and intermediate modules in the locked Stable Diffusion U-Net model to create a copy with the same structure but trainable parameters; connect the output of the trainable copy to the input of the corresponding module in the locked U-Net through a "zero convolutional layer"; c) Training process: Train using the paired datasets constructed in step one; during training, use the heatmap as a control condition. The image is then input into ControlNet; the corresponding spatial layout diagram is used as the target image, and the Stable Diffusion encoder is used to convert it into a low-dimensional latent space representation. ; In the latent space Apply different time steps Gaussian noise, to obtain ; The training goal is to enable the entire system equipped with ControlNet to respond to input... Time step and conditional heatmap It accurately predicts the added noise. The model's loss function is the mean squared error between the predicted noise and the actual noise. By using the backpropagation algorithm, only the parameters of the trainable copy of ControlNet and the zero convolutional layer are updated; this process enables ControlNet to learn the mapping relationship from the abstract area color block layout to the precise room outline lines.

6. The method according to claim 5, characterized in that, The generation of the preliminary layout diagram specifically involves: a) Create a new control heatmap: Based on new project requirements and relevant design specifications, designers set new room agent points and their required areas in the design software, and use the region growing algorithm to generate a brand new control heatmap. b) Conditional Image Generation: This control heatmap is input into a trained StableDiffusion model equipped with ControlNet; the StableDiffusion model generates a random latent space noise vector. Initially, guided precisely by ControlNet, noise is gradually removed through a multi-step reverse diffusion process, ultimately generating a clean latent space representation. ; c) Decoding output: Representing the latent space The Stable Diffusion decoder restores the pixel space, thereby generating a preliminary layout map that strictly follows the spatial structure requirements of the input heatmap.

7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-6.

8. A computer-readable storage medium for storing computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 1-6.