Views
No views yet
1import torch
2from diffusers import FluxPipeline
3
4# Load the base model
5pipeline = FluxPipeline.from_pretrained(
6 "black-forest-labs/FLUX.1-schnell",
7 torch_dtype=torch.bfloat16
8)
9
10# Load the LoRA weights
11pipeline.load_lora_weights("Shah1st/skin-cancer-flux-schnell-lora")
12pipeline = pipeline.to("cuda")
13
14# Generate an image
15prompt = "SKINCANCER: Dermatoscopic image of a common nevus with uniform dark brown coloration"
16image = pipeline(
17 prompt=prompt,
18 num_inference_steps=4,
19 guidance_scale=0.0,
20 height=512,
21 width=512,
22).images[0]