akhaliq HF Staff commited on
Commit
6c5d32a
·
verified ·
1 Parent(s): 755b512

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -9,12 +9,11 @@ pipe = FluxPipeline.from_pretrained(
9
  'black-forest-labs/FLUX.1-dev',
10
  torch_dtype=torch.bfloat16,
11
  use_safetensors=True
12
- )
13
- pipe.to('cuda')
14
 
15
- # Load SRPO weights
16
- state_dict = load_file("diffusion_pytorch_model.safetensors")
17
- pipe.transformer.load_state_dict(state_dict, strict=False)
18
 
19
  @spaces.GPU(duration=120)
20
  def generate_image(
 
9
  'black-forest-labs/FLUX.1-dev',
10
  torch_dtype=torch.bfloat16,
11
  use_safetensors=True
12
+ ).to('cuda')
 
13
 
14
+ # Load SRPO weights from https://huggingface.co/tencent/SRPO
15
+ state_dict = load_file("tencent/SRPO/diffusion_pytorch_model.safetensors")
16
+ pipe.transformer.load_state_dict(state_dict)
17
 
18
  @spaces.GPU(duration=120)
19
  def generate_image(