Run this model with HF Jobs

Run diffusers/tools 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/diffusers/tools. 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/diffusers/tools 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.
File size: 651 Bytes
6c27fdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
import torch
from diffusers import StableDiffusionXLPipeline
  
pipe = StableDiffusionXLPipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16,
).to("cuda")

#Fuse/unfuse first LoRA  
pipe.load_lora_weights("joachimsallstrom/aether-cloud-lora-for-sdxl")
pipe.fuse_lora()
pipe.unload_lora_weights()
pipe.unfuse_lora()

#Now it would be expected that the the LoRA has been unfused and `pipe` in the its original state, however...

#Fuse/unfuse second LoRA
pipe.load_lora_weights("jbilcke-hf/sdxl-zelda64")
pipe.fuse_lora()
pipe.unload_lora_weights()
pipe.unfuse_lora() #errors out