## 4 Methodology and Testing Process
### Testing Process  
The hyperparameter settings of the SD model are crucial to the quality of the generated results, necessitating controlled variable experiments for generation testing. Given the determined version of the SD base model, the variables significantly impacting the results include: input boundaries, selection of the LoRA model, LoRA model weight values,  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Epoch** & **0.6** & **0.8** & **1** & **1.2** & **1.4** \\ \hline \hline Model1 (epoch4) & & & & \\ \hline Model2 (epoch8) & & & & \\ \hline Model3 (epoch12) & & & & \\ \hline Model4 (epoch16) & & & & \\ \hline Model5 (epoch20) & & & & \\ \hline \hline \end{tabular}
\end{table}
Table 4: Testing the Results of LoRA Fine-Tuning.  
Figure 4: Stable Diffusion loss.  
sampling steps, sampler, classifier-free guidance (CFG) scale, random seed, and denoising strength (Table 5) [8; 26].  
The number of sampling steps affects the model's sampling efficiency. If the value is too low, the control exerted by the text on the image will be weak, resulting in high randomness. Conversely, if the value is too high, it will lead to low sampling efficiency and increased computational load on the GPU. The CFG scale serves a similar function to the number of sampling steps. Since a unified text description is used, the default value is adopted and is not included in the comparative test. The sampler is a method used in the denoising process of diffusion models. Currently, the Stable Diffusion web UI supports dozens of samplers. After preliminary testing, we will proceed with experiments using the \"Euler a\" sampler. The random seed determines the initial state of diffusion and is crucial for the generalizability of the generated floor plans. Denoising strength, a hyperparameter in Image-to-Image control, refers to the proportion of the reference image's features extracted by the model [7].  
Draw the nursing unit boundaries on a blank image with a resolution of 512 \(\times\) 1024, preprocess it into a mask image, set the text description to \"a_floorplan_of_nurse_unit\", add the LoRA model, and set the weight values. Design the following three test methods (Figure 5):  
* Image-to-Image 1. Add the preprocessed nursing unit boundary image in the Image-to-Image settings.
* Set various variables for image generation.
* Compare the generation effects of different hyperparameter values.
* Determine the optimal hyperparameter settings.
* Summarize the pros and cons of the method.  
Figure 5: Testing and Generation Framework.  
* 1. Add the preprocessed nursing unit boundary image in the ControlNet settings. 2. Add the ControlNet preprocessor. 3. Compare the generation effects of different preprocessors and hyperparameter values. 4. Determine the optimal hyperparameter settings. 5. Summarize the pros and cons of the method.
* Image-to-Image + ControlNet
* 1. Add the preprocessed nursing unit boundary image in the Image-to-Image settings. 2. Add the preprocessed nursing unit boundary image in the ControlNet settings. 3. Test the best hyperparameters from previous tests. 4. Determine the optimal hyperparameter settings.  
The optimal values obtained from these three test paths can be used interchangeably to reduce repetitive testing.