jieliu's picture
update model
ae070e2 verified
|
raw
history blame
1.3 kB
metadata
base_model: stabilityai/stable-diffusion-3.5-medium
library_name: peft

Model Card for Model ID

This model is trained using Flow-GRPO with LoRA. We provide only the LoRA weights here, so you will need to download the SD 3.5 Medium base model first.

Model Details

Model Sources

Uses

import torch
from diffusers import StableDiffusion3Pipeline
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
from peft import PeftModel

model_id = "stabilityai/stable-diffusion-3.5-medium"
lora_ckpt_path = "jieliu/SD3.5M-FlowGRPO-PickScore"
device = "cuda"


pipe = StableDiffusion3Pipeline.from_pretrained(model_id, torch_dtype=torch.float16)
pipe.transformer = PeftModel.from_pretrained(pipe.transformer, lora_ckpt_path)
pipe.transformer = pipe.transformer.merge_and_unload()
pipe = pipe.to(device)

prompt = 'a jung male cyborg with white hair sitting down on a throne in a dystopian world, digital art, epic'
image = pipe(prompt, height=512, width=512, num_inference_steps=40,guidance_scale=4.5).images[0]  
image.save("flow_grpo_pickscore.png")