|
import torch |
|
import random |
|
from pipeline_flux import FluxPipeline |
|
|
|
lora_path="lora_hubs/pano_lora_720*1440_v1.safetensors" |
|
pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cuda") |
|
pipe.load_lora_weights(lora_path) |
|
pipe.enable_model_cpu_offload() |
|
|
|
prompt = 'A vibrant city avenue, bustling traffic, towering skyscrapers' |
|
|
|
pipe.enable_vae_tiling() |
|
seed = 119223 |
|
|
|
|
|
image = pipe(prompt, |
|
height=720, |
|
width=1440, |
|
generator=torch.Generator("cpu").manual_seed(seed), |
|
num_inference_steps=50, |
|
blend_extend=6, |
|
guidance_scale=7).images[0] |
|
|
|
image.save("result.png") |