Views
No views yet

1import torch
2from diffusers import FluxPipeline
3from peft import PeftModel
4
5model_id = "black-forest-labs/FLUX.1-dev"
6lora_ckpt_path = "Bruece/FLUX.1-dev-CMO-HPSv2"
7device = "cuda"
8
9pipe = FluxPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
10pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_ckpt_path)
11pipe.transformer = pipe.transformer.merge_and_unload()
12pipe = pipe.to(device)
13
14prompt = "a photo of a black kite and a green bear"
15image = pipe(
16 prompt,
17 height=512,
18 width=512,
19 num_inference_steps=40,
20 guidance_scale=4.5
21).images[0]
22
23image.save("flux_cmo_hpsv2_lora.png")1@article{wi2026correlation,
2 title={Correlation-Weighted Multi-Reward Optimization for Compositional Generation},
3 author={Wi, Jungmyung and Kim, Hyunsoo and Kim, Donghyun},
4 journal={arXiv preprint arXiv:2603.18528},
5 year={2026}
6}