## 4 Methodology and Testing Process
### Testing Process
#### 4.3.2 ControlNet  
This section of testing is conducted under the Text-to-Image option. The input images are processed directly by ControlNet in the SD-WebUI, bypassing the influence of the Image-to-Image section. The main factor affecting the results is the choice of the ControlNet preprocessor. Therefore, this section focuses on testing the output results of different preprocessors under different random seeds. Figures 9 and 10 show the generated effects of four ControlNet preprocessors under the optimal hyperparameters determined in the previous sections. It can be seen that none of the preprocessors can generate images that meet the basic requirements (reasonable color block arrangement, accurate color values), and even the background color fails to generate  
Figure 8: Other hyperparameters remain unchanged; the input image is added to the main corridor and the seed is changed. Figure 7: Other hyperparameters remain unchanged; the seed is changed. it can be concluded that Image-to-Image control can produce more accurate color values, color block layouts, and a pure white background, while ControlNet can precisely control the boundaries of the generated layout. Therefore, the next step is to combine both methods for generation testing. Since ControlNet is a post-processing extension of the Image-to-Image function, this test will set the optimal hyperparameters for Image-to-Image to control the boundaries of the generated image. In ControlNet controls, besides the preprocessor directly influencing the results, there are three other variables that can affect its degree of control over the Image-to-Image process: ControlNet weight, Guidance Start, and Guidance End. Preprocessor, ControlNet weight, Guidance Start, and Guidance End: In this section of the test, we first selected Control_canny as the preprocessor and disabled the Guidance End time option to test the ControlNet weight and Guidance Start time. As shown in Figure 11, it can be seen that a ControlNet weight greater than 0.6 can exert significant boundary control on the image result. Increasing the value beyond this threshold does not have a noticeable impact on the results. The Guidance Start time must be set to the initial moment, as intervening at any intermediate point in the Image-to-Image process with ControlNet does not influence the outcome. With the aforementioned hyperparameters held constant, setting the ControlNet weight to 1.2 produced the results shown in Figure 12. The chart indicates that if ControlNet starts at time 0.0 in the Image-to-Image process, the Guidance End time has no significant effect on the final image. Regarding the choice of preprocessor, Control_canny and Control_hed demonstrated more stable performance, achieving reasonable boundary, color block layout, and area proportions. Seed: As previously mentioned, the random seed determines the generalization capability of the SD model. Each random seed represents the initial random state during image generation. If reasonable images can be generated under any random seed input, it demonstrates that the LoRA model trained in this hyperparameter combination can achieve the desired spatial layout for nursing units. Figure 13 shows images generated with different random seeds, covering five random intervals with a total of 25 outputs. Preliminary assessment indicates that approximately 20 of these results (highlighted with dashed lines) are reasonably valid. This demonstrates that the combination of Image-to-Image generation and ControlNet for spatial layout generation is feasible and capable of producing reasonably accurate results. Summaries: The above tests prove that integrating ControlNet into the Image-to-Image process is feasible and can address the issue of weak boundary control in Image-to-Image generation. Under the recommended hyperparameter settings from previous tests, ControlNet's preprocessor should be set to Control-canny or Control-hed. The ControlNet weight should be above 0.6, ideally at 1.2.