﻿# DeepFloyd IF stage handoffs: a tensor output can already be an image

Preserve DeepFloyd IF pixel-space tensors and shared text embeddings across its cascade, without applying an unrelated latent decoder or lossy preview conversion.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-deepfloyd-if-pixel-tensor-stage-handoff/
Language: en

## Identify the pixel-space cascade

The [official IF repository](https://github.com/deep-floyd/IF) describes a text-conditioned image generator assembled from stages. Unlike a workflow that always denoises an autoencoder latent, IF's core cascade operates in pixel space. This difference changes the meaning of intermediate outputs. A floating-point tensor returned by an early stage should not automatically be sent to a Stable Diffusion VAE merely because another application calls its own tensor output a latent.

## Preserve the native stage handoff

The [Diffusers IF examples](https://huggingface.co/docs/diffusers/api/pipelines/deepfloyd_if) request tensor output from an earlier stage and pass that result as the next stage's image condition. Preserve the expected range, axis order, dtype, and batch structure. A preview conversion to a display image is a separate operation. Saving a compressed preview and loading it again can introduce quantization or compression changes that were absent from the intended direct tensor handoff.

## Reuse text conditions deliberately

The documented cascade computes prompt and negative embeddings and supplies them to compatible stages, allowing the later stage to omit a separately loaded text encoder. This is deliberate component reuse, not permission to mix arbitrary encoder outputs. The [base-stage model card](https://huggingface.co/DeepFloyd/IF-I-XL-v1.0) identifies a concrete artifact whose configuration must remain aligned with the selected cascade. Record encoder revision and preprocessing together with cached embeddings so reuse remains a defined interface rather than a shape-only assumption.

## Diagnose a degraded refinement

Imagine a sharp low-resolution result whose enlarged output changes colors or loses structure unexpectedly. Compare the native tensor passed to refinement with any file round-trip introduced by the application. Verify preprocessing and noise-conditioning settings before concluding that the refinement weights are defective. Retain outputs before and after each stage. A final image alone cannot show whether the discrepancy came from base generation, handoff conversion, refinement, or an added external upscaler.

## Describe the entire assembly

Record each stage's checkpoint, component reuse, intermediate representation, and any final upscaler separately. Measure stages independently when diagnosing memory, while retaining an end-to-end figure for the complete request. Existing guides on [tensor axes](/journal/tensor-axes-batch-sequence-hidden/) and [artifact validation](/journal/safetensors-artifact-validation/) provide context. IF's distinctive contract is the pixel-space handoff within a cascade: preserve its semantics rather than inferring meaning from a generic tensor container or a familiar output field name.
