my code doesnt work, help?

#30
by Retolito - opened

from diffusers import DiffusionPipeline, FluxTransformer2DModel
import torch

transformer = FluxTransformer2DModel.from_single_file(
"https://huggingface.co/lllyasviel/flux1-dev-bnb-nf4/flux1-dev-bnb-nf4-v2.safetensors",
torch_dtype=torch.bfloat16 # Use bf16 to save VRAM, or float16
)

pipe = DiffusionPipeline.from_pretrained(
"black-forest-labs/FLUX.1-schnell",
transformer=transformer,
torch_dtype=torch.bfloat16 # Match the dtype for the pipeline
)

pipe.to("cuda")

prompt = "A futuristic cyberpunk cityscape at night, neon lights, detailed, ultra-realistic"
negative_prompt = "blurry, low quality, distorted"

image = pipe(prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=25).images[0]

image.show()

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment