How do I map the torus to a plane? Please see my answer on Perlin noise first.
A bit of background.  Imagine a solid texture, like an actual block of sky and cloud.  If you "cut a sheet" of sky and display it as an image, you'd get something like this:

Now you want that "sheet of sky" to be repeatable, so you cut the sheet of sky by using a torus:

I'm trying to remove the distortion that appears in the resulting image:

Because clearly the portion from the inner side of the donut is "thinner" than the outer side of the donut.
So I need to map the surface of a torus to a unit square.  I'm not sure how to say this correctly but the mapping must be such that each tiny square $dS$ on the unit square must map to something non-square on the surface of the torus.
For a start, I looked at trying a mapping from u, v to spherical coordinates..
$$
\theta = 2 \cos^{-1} \sqrt{1-\zeta_x} \
\phi = 2\pi\zeta_y
$$
But that didn't seem to lead to a solution.

John M. Sullivan's paper Conformal Tiling on a Torus (Bridges 2011) https://static1.bridgesmathart.org/2011/cdrom/proceedings/134/paper_134.pdf gives a forward conformal mapping from $(u,v)$ coordinates in an s~$s\times 1$ rectangle in the plane to $(x,y,z)$ coordinates in 3D space:
$$x = s \cos(2\pi u/s) / w\\
y = s \sin(2\pi u/s) / w\\
z = \sin(2\pi v) / w$$
where
$$w=\sqrt{s^2+1}-\cos(2\pi v)$$
which can be inverted by
$$u = \frac{s}{2 \pi} \tan^{-1}\frac{y}{x} \\
v = \frac{\mathrm{sign}(z)}{2 \pi} \cos^{-1} \frac{ z^2 \sqrt{s^2+1} \pm \sqrt{1-z^2 s^2} }{z^2+1}$$
Conformal mappings preserve angles, taking infinitesimal circles to infinitesimal circles without stretching/squeezing distortion (which would give ellipses or worse). See the paper for plenty of pictures. I blogged about it with GLSL source code https://mathr.co.uk/blog/2016-12-05_calendar_2015_donut.html and video https://mathr.co.uk/blog/2013-04-18_rolling_torus.html (click picture).
