Run this model with HF Jobs

Run fusing/ddim-lsun-church on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/fusing/ddim-lsun-church. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/fusing/ddim-lsun-church on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Model currently broken

#1
by marshalljiang - opened

As of 2/6/24 with diffusers version 0.26.2, using the code in the documentation, an error is raised running on Google Colab and personal installtion.

from diffusers import DiffusionPipeline
import PIL.Image
import numpy as np

model_id = "fusing/ddim-lsun-church"

# load model and scheduler
ddpm = DiffusionPipeline.from_pretrained(model_id)

# run pipeline in inference (sample random noise and denoise)
image = ddpm(eta=0.0, num_inference_steps=50)

# process image to PIL
image_processed = image.cpu().permute(0, 2, 3, 1)
image_processed = (image_processed + 1.0) * 127.5
image_processed = image_processed.numpy().astype(np.uint8)
image_pil = PIL.Image.fromarray(image_processed[0])

# save image
image_pil.save("test.png")

with error

AttributeError: module diffusers has no attribute DDIM

Similarly, using the documented code on https://huggingface.co/docs/diffusers/en/api/pipelines/ddim

from diffusers import DDIMPipeline
import PIL.Image
import numpy as np

# load model and scheduler
pipe = DDIMPipeline.from_pretrained("fusing/ddim-lsun-bedroom")

# run pipeline in inference (sample random noise and denoise)
image = pipe(eta=0.0, num_inference_steps=50)

# process image to PIL
image_processed = image.cpu().permute(0, 2, 3, 1)
image_processed = (image_processed + 1.0) * 127.5
image_processed = image_processed.numpy().astype(np.uint8)
image_pil = PIL.Image.fromarray(image_processed[0])

# save image
image_pil.save("test.png")

results in

AttributeError: module diffusers has no attribute UNetModel

Any help is appreciated.

Sign up or log in to comment