Views
No views yet
stabilityai/stable-diffusion-3.5-medium trained with Higgsfield.1import torch
2from diffusers import StableDiffusion3Pipeline
3from higgsfield.adapters.token_mod import GlobalTokenModulator
4from huggingface_hub import hf_hub_download
5
6base_model = "stabilityai/stable-diffusion-3.5-medium"
7repo_id = "ritam5013/sd3.5-attn-1024-v1"
8
9pipe = StableDiffusion3Pipeline.from_pretrained(base_model, torch_dtype=torch.bfloat16).to("cuda")
10# download adapter
11adapter_path = hf_hub_download(repo_id, filename="token_mod.pt")
12# load adapter
13mod = GlobalTokenModulator(num_tokens=333, embed_dim=4096, out_channels=pipe.transformer.config.in_channels)
14mod.load_state_dict(torch.load(adapter_path, map_location="cpu"))
15mod.to("cuda").eval()
16# Now use your own inference loop adding bias from `mod` like in your codebase.token_mod.pt adapter weightsrun.json metadatamanifest.md human summary