"sgl-kernel/git@developer.sourcefind.cn:zhaoyu6/sglang.git" did not exist on "6fd4816d9f1ae31124139e6a6bfb20b141694e9b"
Flux_test.py 488 Bytes
Newer Older
lijian6's avatar
lijian6 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import torch,time
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained("./FLUX.1-dev/", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()

prompt = "a tiny astronaut hatching from an egg on the moon"
for i in range(3):
    start = time.time()
    out = pipe(
        prompt=prompt,
        guidance_scale=3.5,
        height=768,
        width=1360,
        num_inference_steps=50,
    ).images[0]
    print(f"Time:{time.time()-start}")
out.save("image.png")