|
from diffusers import DiffusionPipeline, StableDiffusionPipeline |
|
import torch |
|
|
|
|
|
model_id = "black-forest-labs/FLUX.1-dev" |
|
lora_model_path = "codermert/tugce2-lora" |
|
|
|
|
|
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16) |
|
pipe.to("cuda") |
|
|
|
|
|
pipe.unet.load_attn_procs(lora_model_path) |
|
|
|
|
|
prompt = "A portrait of a woman with brown hair, smiling, high quality, detailed" |
|
negative_prompt = "blurry, low quality, distorted" |
|
|
|
|
|
image = pipe(prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=30, guidance_scale=7.5).images[0] |
|
|
|
|
|
image.save("generated_image.png") |