Using a distance from a single image to a single prompt is usually too restrictive. Therefore, and in practice, the distance is computed over pairs of multiple images and texts as follows:
On the image side, \(n\)  patches (a.k.a. cutouts. We use these two terms interchangeably),
which we denote as \(x_1, \cdots , x_n = S(x)\)  are randomly sampled from image \(x\)  in the fashion of image data augmentation [1]}.
We assume \(x_i \in \mathbb {R}^{h \times w \times 3}\)  still holds since we can trivially add a resizing step at the end of augmentation.
This practice serves as a regularizer to ensure numerical stability and avoid fitting into regions of \(z\)  where \(G\)  has bad support.
On the text side, \(m\)  text prompts, denoted as \(t_{1}, \cdots , t_{m}\) , are often considered,
which allows artists to explore the possibilities of art by combining multiple texts as directions.
Again, they are encoded accordingly, giving \(u_1, \cdots , u_n: u_i = E_{\mathrm {I}}(x_i) \in \mathbb {R}^d\)  and \(v_1, \cdots , v_m: v_j = E_{\mathrm {T}}(t_j) \in \mathbb {R}^d\) .
These pairwise distances are then combined to form a loss, which is
\( F(z) = \mathrm {Mean}_{D}(z) \mathrel {\overset{\makebox{[}0pt]{\mbox{\normalfont \tiny \sffamily def}}}{=}}\frac{1}{mn} \sum _{1\le i\le n, 1\le j \le m} D(u_i, v_j),\) 
