File size: 1,000 Bytes
ee8b939 58c2804 ee8b939 58c2804 ee8b939 58c2804 ee8b939 58c2804 ee8b939 2287959 58c2804 ee8b939 58c2804 ee8b939 58c2804 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import torch
from diffusers import Flux2KleinPipeline
pipe = Flux2KleinPipeline.from_pretrained(
"./FLUX.2-9B-bnb-4bit",
torch_dtype=torch.bfloat16,
device_map="cuda", # REQUIRED
)
#pipe.to("cuda")
#pipe.enable_model_cpu_offload() # save some VRAM by offloading the model to CPU
from PIL import Image
init_image = Image.open("suji.jpg").convert("RGB")
#prompt = "an very beautiful sexy korean kpop young woman with white bikini is smiling on the waikiki beach. hiqh quality realistic photo."# pixar 3d style"
#prompt = "beautiful woman in the beach holding plate with Circulus "
prompt = "νΌλΆκ° λλ¬λλ ν°μ λλ μ€λ₯Ό μ
μλ€." #νμμμ μΉμν λλ μ€λ₯Ό μ
μ μλ¦λ€μ΄ νκ΅ μ¬μ±"
image = pipe(
prompt=prompt,
image=init_image,
height=1024,
width=1024,
guidance_scale=1.0,
num_inference_steps=4,
generator=torch.Generator(device="cuda").manual_seed(0)
).images[0]
image.save("./output/flux_suji10.png")
|