Views
No views yet

1conda create -n nextstep python=3.11 -y
2conda activate nextstep
3
4pip install uv # optional
5
6GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/stepfun-ai/NextStep-1.1 && cd NextStep-1.1
7uv pip install -r requirements.txt
8
9hf download stepfun-ai/NextStep-1.1 "vae/checkpoint.pt" --local-dir ./1import torch
2from transformers import AutoTokenizer, AutoModel
3from models.gen_pipeline import NextStepPipeline
4
5HF_HUB = "stepfun-ai/NextStep-1.1"
6
7# load model and tokenizer
8tokenizer = AutoTokenizer.from_pretrained(HF_HUB, local_files_only=True, trust_remote_code=True)
9model = AutoModel.from_pretrained(HF_HUB, local_files_only=True, trust_remote_code=True)
10pipeline = NextStepPipeline(tokenizer=tokenizer, model=model).to(device="cuda", dtype=torch.bfloat16)
11
12# set prompts
13positive_prompt = ""
14negative_prompt = "lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry."
15example_prompt = "A REALISTIC PHOTOGRAPH OF A WALL WITH \"TOWARD AUTOREGRESSIVE IMAGE GENERATION WITH CONTINUOUS TOKENS AT SCALE\" PROMINENTLY DISPLAYED"
16
17# generate image from text
18IMG_SIZE = 512
19image = pipeline.generate_image(
20 example_prompt,
21 hw=(IMG_SIZE, IMG_SIZE),
22 num_images_per_caption=1,
23 positive_prompt=positive_prompt,
24 negative_prompt=negative_prompt,
25 cfg=7.5,
26 cfg_img=1.0,
27 cfg_schedule="constant",
28 use_norm=False,
29 num_sampling_steps=28,
30 timesteps_shift=1.0,
31 seed=3407,
32)[0]
33image.save("./assets/output.jpg")1@article{nextstepteam2025nextstep1,
2 title={NextStep-1: Toward Autoregressive Image Generation with Continuous Tokens at Scale},
3 author={NextStep Team and Chunrui Han and Guopeng Li and Jingwei Wu and Quan Sun and Yan Cai and Yuang Peng and Zheng Ge and Deyu Zhou and Haomiao Tang and Hongyu Zhou and Kenkun Liu and Ailin Huang and Bin Wang and Changxin Miao and Deshan Sun and En Yu and Fukun Yin and Gang Yu and Hao Nie and Haoran Lv and Hanpeng Hu and Jia Wang and Jian Zhou and Jianjian Sun and Kaijun Tan and Kang An and Kangheng Lin and Liang Zhao and Mei Chen and Peng Xing and Rui Wang and Shiyu Liu and Shutao Xia and Tianhao You and Wei Ji and Xianfang Zeng and Xin Han and Xuelin Zhang and Yana Wei and Yanming Xu and Yimin Jiang and Yingming Wang and Yu Zhou and Yucheng Han and Ziyang Meng and Binxing Jiao and Daxin Jiang and Xiangyu Zhang and Yibo Zhu},
4 journal={arXiv preprint arXiv:2508.10711},
5 year={2025}
6}