import torch from diffusers import FluxPipeline import datetime # transformers,numpy,accelerate,sentencepiece,protobufのinstall pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) pipe.enable_model_cpu_offload() #save some VRAM by offloading the model to CPU. Remove this if you have enough GPU power prompt = "A cat holding a sign that says hello world"start_time = datetime.datetime.now() image = pipe( prompt, height=512, width=512, guidance_scale=3.0, output_type="pil", num_inference_steps=30, max_sequence_length=256, generator=torch.Generator("cuda").manual_seed(0) ).images[0] elapsed_time = datetime.datetime.now() - start_time print(elapsed_time) image.save("flux-dev.png")