\section{Background}
\label{sec:background}

\subsection{Controllable Generation}
\label{sec:pipline_of_controllable_generation} 

\textbf{Zero-shot Controllable Generation.} Diffusion model \citep{ho2020denoising} and related flow matching models \citep{lipmanflow} have been widely applied across diverse domains, including image synthesis~\citep{rombach2022high, podellsdxl, lu2025dpm}, video generation~\citep{openai2024sora, guan2025taming}, 3D object generation~\citep{poole2023dreamfusion, chen2025microdreamer}, and material design~\citep{jiao2023crystal, wu2026dmflow,li2026unipath}. Building on these advances, controllable generation aims to guide these generative models toward samples that satisfy user-specified conditions or constraints, such as text prompts~\citep{chung2023diffusion, domingo2025adjoint, ye2024tfg}, spatial constraints~\citep{zhang2023adding}, or physical properties~\citep{vatani2025tripoptimizer, wu2026dao, chen2026optimization}. 

Given a fixed constraint cost model, existing controllable generation methods can be broadly categorized into training-based and training-free approaches. Training-based methods, such as \citet{domingo2025adjoint}, rely on additional constraint-related data to fine-tune the base generative model. In contrast, training-free, or zero-shot, methods, such as \citet{chung2023diffusion}, require no extra training data and instead incorporate the cost model as a plug-in guidance module during generation. 

Our work belongs to the training-free paradigm of controllable generation, focusing on the incorporation of exact symmetry constraints into diffusion-based optimization. Symmetric pattern generation is naturally a zero-shot problem, since real-world datasets rarely contain samples that strictly satisfy prescribed symmetry constraints. We decouple exact symmetry from task-specific objectives by enforcing symmetry through the representation, while imposing other requirements via loss functions. Starting from randomly initialized design parameters, we generate designs by optimizing the symmetric representation with the corresponding task-specific losses. The overall generation pipeline and its correspondence to the main technical components are illustrated in \cref{fig:pipeline}.

\begin{figure*}[!htbp]
    \centering
    \includegraphics[width=0.8\linewidth]{Figure/pipeline.png}
    \caption{Overview of our training-free controllable generation pipeline.}
    \label{fig:pipeline}
\end{figure*}

\textbf{Stylized Topology Generation.}
In mechanical engineering, topology optimization improves structural performance by optimizing the spatial distribution of materials within a prescribed design domain \citep{bendsoe2013topology}, with representative algorithms including the solid isotropic material with penalization (SIMP) method \citep{andreassen2011efficient}. In periodic material design, topology optimization is often combined with homogenization methods, which evaluate the effective macroscopic properties of the optimized microstructures \citep{bendsoe2013topology}.

Several recent works have explored the trade-off between mechanical performance and visual appearance in material design \citep{martinez2015structure, zhongTopologyOptimizationTextguided2023}. The most related work is \citet{zhongTopologyOptimizationTextguided2023}, which jointly optimizes the mechanical performance of a binary material mask, represented by the alpha channel, and its semantic similarity to a text description, measured through the RGB image channel. This approach relies on pre-trained vision-language models, which provide a shared embedding space for visual and textual representations \citep{radford2021learning, chen2023vlp}. Unlike our approach in \cref{sec:topo_design}, it models the material mask as an additional channel rather than extracting it through segmentation. In addition, connectivity is encouraged by penalizing the area of small connected components.

However, such channel-based mask modeling can be vulnerable to the generative prior. Since the diffusion prior favors visually realistic RGB content, the optimized image may fill the masked material region with background-like textures or semantic content, weakening the correspondence between the visual appearance and the actual material layout. Moreover, the connectivity penalty only suppresses disconnected components rather than actively reconnecting them to the main structure, making it difficult to repair or refine the optimized topology.

Our method instead focuses on periodic structure design and derives the material layout from the generated appearance through segmentation, which better aligns the visual content with the optimized mask structure. Motivated by diffusion-prior-based optimization methods such as DreamFusion \citep{poole2023dreamfusion}, we introduce a diffusion prior to improve visual quality while optimizing the periodic material representation. Furthermore, rather than merely penalizing small isolated components, we incorporate a differentiable VTM loss into the objective, which provides a more direct mechanism for controlling and improving structural connectivity.


\textbf{Material Design and Symmetry Constraints.}
Planar- and space-group symmetries provide a natural language for describing periodic structures. In materials science, crystals are a representative class of discrete periodic structures: their unit cells are microscopic atomic arrangements, often modeled as graphs whose nodes correspond to atoms. Metamaterials, in contrast, provide a continuous counterpart: their unit cells are mesoscopic structures composed of continuum materials and are represented by binary masks, where the values indicate the absence or presence of material. For both crystals and metamaterials, symmetry plays a crucial role in determining material properties \citep{levy2025symmcd, mao2020designing}.

Recent works in crystal and metamaterial generation have therefore studied how to ensure that generated structures exactly satisfy prescribed symmetries. In crystal generation, \citet{jiaospace} considers generation under a given space-group type together with the site symmetry of atoms, which can be regarded as a symmetry template. From the perspective of controllable generation, \citet{jiaospace} puts symmetry constraints into the generation process through this prescribed template. \citet{levy2025symmcd} follows a conditional-generation formulation and further relaxes the dependence on predefined templates by treating the atomic site symmetries as generative variables. Given a space-group type and the number of orbit representatives, it learns the site-symmetry assignments from data and reconstructs the full crystal by replicating the generated asymmetric unit.

In metamaterial design, \citet{mao2020designing} study the generation of two-dimensional metamaterials under prescribed planar-group symmetries. Their method requires training a symmetry-specific generative model for each plane group using symmetric unit-cell masks. In contrast, when applied to symmetric metamaterial generation, our method does not require symmetry training data or a separately trained model for each symmetry group. Instead, our method only needs a generator trained on $p1$ periodic patterns, i.e., patterns without additional symmetry. To generate a pattern with a desired symmetry, we optimize our symmetric representation using the SDS loss. Therefore, changing the target symmetry does not require collecting symmetry-specific data or retraining the generator.


\subsection{Other Symmetrization.}
\label{sec:other_symmetrization}

We compare our method with several natural alternatives for enforcing planar-group symmetry. These alternatives can be divided into two categories: enforcing symmetry directly in the parameter space of a representation, and transforming the output function after evaluation.

\textbf{Constraining the Parameter Space.}
A seemingly direct approach is to impose symmetry constraints on the parameters of a continuous representation. However, this strategy is generally impractical for two reasons. First, plane groups are infinite because they contain translations, which would in principle induce infinitely many equality constraints. Solving such constraints numerically is therefore intractable without additional truncation or approximation. Second, for modern continuous representations such as NeRF~\citep{mildenhall2021nerf} and InstantNGP~\citep{mullerInstantNeuralGraphics2022}, the mapping from parameters to function values is highly nonlinear. As a result, even if the symmetry constraints are linear, there may not be an explicit or numerical tractable solution of parametrization of the corresponding symmetric parameter subspace.

\textbf{Transforming the Output Representation.}
Another class of methods enforces symmetry at the value of function. Besides our method, we consider three alternative approach. The first is group averaging, which averages the representation output over all symmetry-transformed inputs. Although this produces an invariant function in principle, it is infeasible for infinite plane groups, which only yields approximate symmetry. The second is asymmetric-unit extension, which parametrizes the function only on an asymmetric unit and extends it to the whole domain via group actions. This approach is efficient and direct, but it can introduce boundary discontinuities when the asymmetric unit is not a reflection chamber or when adjacent regions are related by non-reflective transformations. The third is basis projection, which projects a general representation onto an invariant function space spanned by symmetry-adapted basis functions. This approach is theoretically valid, but in practice it suffers from severe computational and optimization limitations, as discussed below.

\textbf{Complexity of Basis Projection.}
Let the target image resolution be $n \times n$. A natural choice of basis for plane-group-symmetric functions is the trigonometric basis. By the Nyquist sampling theorem, the number of recoverable frequency components is on the same order as the number of pixels in the asymmetric unit. Let $\alpha$ denote the fraction of frequency components retained, and let $\beta$ denote the number of asymmetric-unit copies in the full unit cell. Then the number of basis functions is approximately $m \approx \alpha n^2 / \beta$. Projection requires orthogonalizing $m$ basis functions, where each basis function is sampled as an $n^2$-dimensional vector. By applying QR decomposition, this leads to a time complexity of $O(m^2 n^2) = O(n^6)$, and a memory complexity of $O(m n^2) = O(n^4)$. Therefore, both runtime and memory become prohibitive at high resolutions. In contrast, our method introduces only a constant per-pixel time cost from reflection operations and the evaluation of the fixed basis functions $\eta_i$. The overall evaluation cost remains linear in the number of pixels, namely $O(n^2)$, making the method substantially more efficient in both time and memory.

\textbf{Effect on Generation Quality.}
Basis projection also has an unfavorable effect on generation. For locally supported representations, pixel values in different unit cells are initialized independently. After projection, values related by symmetry are aggregated, which reduces variance and produces an overly smooth initialization. This is problematic for SDS-based optimization, whose performance is sensitive to initialization. In particular, approximately Gaussian-like random initializations tend to provide richer high-frequency content and more diverse optimization trajectories, whereas projected initializations are biased toward low-frequency smooth patterns. As a result, projection-based symmetrization often degrades visual quality. In our pattern-generation experiments in \cref{sec:pattern_results}, our method consistently achieves better generation quality than the projection-based baseline, as reflected by higher CLIP-A scores across different resolutions.

