NanoDreamer

NanoDreamer

NanoDreamer is a compact unconditional image generator that hallucinates the interiors of buildings. It dreams rooms, corridors, halls, windows, walls, lighting, and sometimes impossible architectural spaces from a 128-dimensional latent vector.

NanoDreamer inference architecture

The model receives no text prompt, reference image, layout, or semantic label. Its only input is 128 floating-point values sampled from a standard normal distribution. The same latent vector always produces the same image, while changing individual values can alter structure, lighting, color, apparent materials, or other learned visual features.

NanoDreamer is not a diffusion model. It generates an entire 256 × 256 image in one decoder pass. The diffusion model was used to create its training data, not during NanoDreamer inference.

Synthetic dataset

The training set contains 20,000 entirely synthetic 512 × 512 JPEG images generated by the Z-Image diffusion model. The generation prompts described varied building interiors and liminal architectural spaces. Prompt diversity produced different room types, dimensions, lighting conditions, materials, colors, camera positions, and degrees of architectural realism.

Only the generated images were used to train NanoDreamer. Their prompts were not provided to the model, so there is no text-conditioning pathway and no correspondence between words and latent dimensions.

During training, images are converted to RGB, resized to 256 × 256 with bicubic interpolation, normalized to [-1, 1], and randomly flipped horizontally. Because every source image is synthetic, NanoDreamer learns a compressed distribution of Z-Image's interpretation of interior spaces rather than a distribution of real photographs.

Architecture

NanoDreamer V1 is an adversarial variational autoencoder trained at 256 × 256 resolution:

  • Latent space: 128 dimensions
  • Inference component: approximately 43 million-parameter decoder
  • Initial projection: 128 → 4 × 4 × 1024
  • Six nearest-neighbor upsampling stages: 4 → 8 → 16 → 32 → 64 → 128 → 256
  • Convolution, BatchNorm, LeakyReLU, and residual blocks at every stage
  • Channel width decreases from 1024 channels at low resolution to 32 channels at 256 × 256
  • Final RGB convolution followed by tanh
  • Output tensor: [1, 3, 256, 256] in the [-1, 1] range

The encoder and discriminator exist only during training. The exponential-moving-average decoder is the complete generative model used for inference and exported to ONNX.

Training objectives

The training objective combines several signals:

  • Multiscale L1 reconstruction: teaches the encoder and decoder to preserve both large spatial structure and local appearance.
  • KL regularization with free bits: shapes the encoded distribution toward a sampleable standard-normal latent space without immediately collapsing every dimension.
  • Adversarial loss: encourages reconstructed and randomly sampled outputs to resemble images from the synthetic interior dataset.
  • Discriminator feature matching: provides a more stable structural and perceptual signal than adversarial classification alone.
  • Latent-cycle loss: samples a random latent vector, generates an image, re-encodes it, and penalizes disagreement with the original vector.
  • Latent variance and covariance losses: discourage dead dimensions and excessive correlation between latent axes.

The latent-specific objectives are important to the experiment. They encourage more of the 128 coordinates to remain usable so that changing one neuron has a visible chance of changing the generated dream. They do not assign a predefined meaning to any coordinate: semantic behavior emerges from training and may be entangled across multiple neurons.

How NanoDreamer hallucinates

At inference time, a vector z ~ N(0, I) is projected into a learned 4 × 4 feature map. The decoder repeatedly expands this representation while reducing channel depth, progressively turning an abstract spatial code into surfaces, boundaries, openings, shadows, and room-like geometry.

The model does not construct a 3D scene and then render it. It directly synthesizes pixels that are statistically consistent with its synthetic training set. This is why outputs can feel recognizably architectural while containing impossible perspective, repeated structures, fused rooms, false openings, or geometry that only works as an image. In this model, “dreaming” or “hallucinating” means sampling and decoding that learned visual distribution without conditioning or external guidance.

ONNX variants

  • FP32: the full exponential-moving-average decoder exported to ONNX.
  • UINT8: statically quantized QOperator model using unsigned 8-bit activations and weights. Calibration uses random standard-normal latent samples; quantization is per-tensor rather than per-channel.

Both variants accept a float32 tensor named latent with shape [1, 128] and return an image tensor named image with shape [1, 3, 256, 256].

Limitations

NanoDreamer is deliberately narrow. It only models synthetic interior imagery, cannot follow text instructions, and does not understand architecture as a physical system. Its 128-dimensional latent space is not guaranteed to be disentangled: one neuron can affect several visual properties, and a recognizable property may depend on many neurons together.

The model can reproduce systematic biases and artifacts present in the Z-Image-generated dataset. It should be treated as a small generative experiment and an explorable compression of a synthetic image distribution, not as a general-purpose image generator or architectural design tool.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support