ferrotorch/sd-v1-5-unet

Stable Diffusion 1.5 UNet2DConditionModel (runwayml/stable-diffusion-v1-5, unet/ subfolder). 4 down-blocks (CrossAttn ร—3 + DownBlock2D), UNetMidBlock2DCrossAttn, 4 up-blocks (UpBlock2D + CrossAttn ร—3); block_out_channels=[320, 640, 1280, 1280], layers_per_block=2, attention_head_dim=8, cross_attention_dim=768. ~860M-param noise predictor. RAIL-M licensed. Real-artifact baseline for SD UNet parity vs diffusers (#1151).

Provenance

  • Upstream: runwayml/stable-diffusion-v1-5 (subfolder unet/), openrail.
  • Conversion script: ferrotorch/scripts/pin_pretrained_diffusion_weights.py.
  • Ferrotorch issue: https://github.com/dollspace-gay/ferrotorch/issues/1151.
  • SHA-256 of model.safetensors (this file is pinned in ferrotorch-hub/src/registry.rs): 2a79ed44ee0eb33080c28498a200a3c79f112db86ddf5bfc81744793d56ab8b9.
  • Number of trainable parameters in the UNet: 859,520,964.
  • Config snapshot: block_out_channels=[320, 640, 1280, 1280], layers_per_block=2, attention_head_dim=8, cross_attention_dim=768, norm_num_groups=32, sample_size=64, in_channels=4, out_channels=4, down_block_types=['CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'CrossAttnDownBlock2D', 'DownBlock2D'], up_block_types=['UpBlock2D', 'CrossAttnUpBlock2D', 'CrossAttnUpBlock2D', 'CrossAttnUpBlock2D'].

Value-parity probe

Four extra files are uploaded so the ferrotorch-side harness can reproduce the parity verdict without re-running the upstream UNet2DConditionModel. The CLIP-ViT-L/14 text encoder is not yet pinned (Phase B.3c), so this probe uses a synthetic encoder_hidden_states tensor โ€” the harness exercises the UNet forward pass deterministically without depending on the text encoder.

  • _value_parity_noisy_latent.bin โ€” torch.manual_seed(42); torch.randn(1, 4, 64, 64), float32.
  • _value_parity_timestep.bin โ€” torch.tensor([500.0]), float32.
  • _value_parity_text_embedding.bin โ€” torch.manual_seed(43); torch.randn(1, 77, 768), float32.
  • _value_parity_predicted_noise.bin โ€” float32 noise prediction [1, 4, 64, 64] from UNet2DConditionModel(sample=noisy_latent, timestep=timestep, encoder_hidden_states=text_embedding, return_dict=False)[0] on float32 weights in eval mode. Same dump format as every other ferrotorch artifact: [u32 ndim][u32 ร— ndim shape][f32 ร— prod(shape)] little-endian.

How to load

use ferrotorch_diffusion::{UNet2DConditionConfig, load_unet};
use ferrotorch_hub::{HubCache, hf_download_model};

let cache = HubCache::with_default_dir();
let repo_dir = hf_download_model("ferrotorch/sd-v1-5-unet", "main", &cache)?;
let cfg = UNet2DConditionConfig::from_file(&repo_dir.join("config.json"))?;
let (unet, _drop_report) = load_unet::<f32>(
    &repo_dir.join("model.safetensors"),
    cfg,
    /* strict = */ true,
)?;

Upstream license

Stable Diffusion v1.5 is distributed under the CreativeML Open RAIL-M license. The decoder slice mirrored here inherits that license โ€” see https://huggingface.co/runwayml/stable-diffusion-v1-5/blob/main/LICENSE for the full terms.

Downloads last month
10
Safetensors
Model size
0.9B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support