Quickstart DifixPipeline with diffusers
mainYou can use the DifixPipeline via the diffusers library for single-step diffusion-based artifact removal.
Standard Usage:
Load the pretrained model nvidia/difix and pass an input image with a prompt (e.g., "remove degradation").
With Reference Image:
To guide the denoising process, use the nvidia/difix_ref model and provide a ref_image to the pipeline call.
from pipeline_difix import DifixPipeline
from diffusers.utils import load_image
# Standard usage
pipe = DifixPipeline.from_pretrained("nvidia/difix", trust_remote_code=True)
pipe.to("cuda")
input_image = load_image("assets/example_input.png")
prompt = "remove degradation"
output_image = pipe(prompt, image=input_image, num_inference_steps=1, timesteps=[199], guidance_scale=0.0).images[0]
output_image.save("example_output.png")