File size: 447 Bytes
b72c044
5a3f5a7
a4a7f14
ee414c2
a4a7f14
 
 
ee414c2
a4a7f14
 
 
91a1b60
ee414c2
a4a7f14
ee414c2
a4a7f14
 
 
 
c1ba63c
a4a7f14
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import torch
from diffusers import FluxPipeline

# Force CPU
os.environ["CUDA_VISIBLE_DEVICES"] = ""
os.environ["DIFFUSERS_NO_BITSANDBYTES"] = "1"

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.1-dev",
    torch_dtype=torch.float32
)

pipe.to("cpu")

image = pipe(
    prompt="a cinematic portrait of a cyberpunk warrior",
    num_inference_steps=20
).images[0]

image.save("output.png")
print("✅ Generated on CPU")