Views
No views yet
, alphonse mucha style to trigger the image generation.1from diffusers import FluxPipeline
2import torch
3
4ckpt_id = "black-forest-labs/FLUX.1-dev"
5pipeline = FluxPipeline.from_pretrained(
6 ckpt_id, torch_dtype=torch.float16
7)
8pipeline.load_lora_weights("derekl35/alphonse-mucha-fp8-lora-flux", weight_name="pytorch_lora_weights.safetensors")
9pipeline.enable_model_cpu_offload()
10
11image = pipeline(
12 "a puppy in a pond, alphonse mucha style",
13 num_inference_steps=28,
14 guidance_scale=3.5,
15 height=768,
16 width=512,
17 generator=torch.manual_seed(0)
18).images[0]
19image.save("alphonse_mucha_loaded.png")1from diffusers import FluxPipeline, AutoPipelineForText2Image, FluxTransformer2DModel
2import torch
3
4ckpt_id = "black-forest-labs/FLUX.1-dev"
5pipeline = FluxPipeline.from_pretrained(
6 ckpt_id, text_encoder=None, text_encoder_2=None, torch_dtype=torch.float16
7)
8pipeline.load_lora_weights("derekl35/alphonse-mucha-fp8-lora-flux", weight_name="pytorch_lora_weights.safetensors")
9pipeline.fuse_lora()
10pipeline.unload_lora_weights()
11
12# You can save the fused transformer for later use
13# pipeline.transformer.save_pretrained("fused_transformer")
14
15pipeline.enable_model_cpu_offload()
16image = pipeline(
17 "a puppy in a pond, alphonse mucha style",
18 num_inference_steps=28,
19 guidance_scale=3.5,
20 height=768,
21 width=512,
22 generator=torch.manual_seed(0)
23).images[0]
24image.save("alphonse_mucha_merged.png")