Views
No views yet
[!WARNING] we do not have a full checkpoint conversion validation, if you encounter pipeline loading failure and unsidered output, please contact me via bili_sakura@zju.edu.cn
1# From the repo root
2python inference_demo.py1from diffusers import StableDiffusionControlNetPipeline, ControlNetModel, UniPCMultistepScheduler
2import torch
3
4repo = "/path/to/controlearth" # or "." when run from repo root
5controlnet = ControlNetModel.from_pretrained(f"{repo}/controlnet", torch_dtype=torch.float16)
6pipe = StableDiffusionControlNetPipeline.from_pretrained(
7 repo, controlnet=controlnet, torch_dtype=torch.float16,
8 safety_checker=None, requires_safety_checker=False
9)
10pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config)
11pipe.enable_model_cpu_offload()
12
13image = pipe("convert this openstreetmap into its satellite view", num_inference_steps=50, image=control_image).images[0]