Text-to-Image
Diffusers
Safetensors
xwwshen commited on
Commit
99ac944
·
verified ·
1 Parent(s): a7fec0e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -15
README.md CHANGED
@@ -45,21 +45,23 @@ The `diffusion_pytorch_model_onlinehps.safetensors` is online version of SRPO ba
45
  #### Inference
46
  Replace the `ddiffusion_pytorch_model_onlinehps.safetensors` of FLUX
47
  ```python
48
- pipe = FluxPipeline.from_pretrained('your dir',
49
- torch_dtype=torch.bfloat16,
50
- use_safetensors=True
51
- ).to("cuda")
52
- state_dict = load_file("yourpath")
53
- pipe.transformer.load_state_dict(state_dict)
54
- image = pipe(
55
- prompt,
56
- guidance_scale=3.5,
57
- height=1024,
58
- width=1024,
59
- num_inference_steps=infer_step,
60
- max_sequence_length=512,
61
- generator=generator
62
- ).images[0]
 
 
63
  ```
64
  ### License
65
  SRPO is licensed under the License Terms of SRPO. See `./License.txt` for more details.
 
45
  #### Inference
46
  Replace the `ddiffusion_pytorch_model_onlinehps.safetensors` of FLUX
47
  ```python
48
+ from diffusers import FluxPipeline
49
+ prompt='The Death of Ophelia by John Everett Millais, Pre-Raphaelite painting, Ophelia floating in a river surrounded by flowers, detailed natural elements, melancholic and tragic atmosphere'
50
+ pipe = FluxPipeline.from_pretrained('./data/flux',
51
+ torch_dtype=torch.bfloat16,
52
+ use_safetensors=True
53
+ ).to("cuda")
54
+ state_dict = load_file("./srpo/diffusion_pytorch_model.safetensors")
55
+ pipe.transformer.load_state_dict(state_dict)
56
+ image = pipe(
57
+ prompt,
58
+ guidance_scale=3.5,
59
+ height=1024,
60
+ width=1024,
61
+ num_inference_steps=infer_step,
62
+ max_sequence_length=512,
63
+ generator=generator
64
+ ).images[0]
65
  ```
66
  ### License
67
  SRPO is licensed under the License Terms of SRPO. See `./License.txt` for more details.