ErnieImageTransformer2DModel has no from_single_file; selecting an
Ernie finetune in the UNET dropdown previously crashed with
"is not a valid JSON file" from from_pretrained.
Probe of jibMixErnie_v20.safetensors: 409/409 keys overlap with the
model state dict after stripping model.diffusion_model., zero missing
or unexpected. Spec is the minimum TransformerSpec(cls=...).
Diffusers ships only ErnieImagePipeline (txt2img). Adds two
subclasses wrapping it: ErnieImageImg2ImgPipeline and
ErnieImageInpaintPipeline, registered into the auto-pipeline
mappings so set_diffuser_pipe swap finds them.
Encode mirrors the upstream decode: vae.encode -> _patchify_latents
-> BN-stats normalize using vae.bn.running_mean/running_var.
Inpaint blends the denoised latent with a noise-level-matched
init latent via callback_on_step_end. Verified end-to-end through
hires upscale and yolo detailer with face and eye masks.