File size: 1,101 Bytes
d390e41 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
---
# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
# Doc / guide: https://huggingface.co/docs/hub/model-cards
{}
---
# Model Card for Model ID
copy/paste/save as inference.py
```
from diffusers import DiffusionPipeline
import argparse
# Parse command line arguments
parser = argparse.ArgumentParser(description='Generate an image using a Hugging Face diffusion model')
parser.add_argument('--model', type=str, default="uisikdag/ddpm-few-shot-art-painting",
help='Hugging Face model name/path')
parser.add_argument('--steps', type=int, default=500,
help='Number of inference steps')
args = parser.parse_args()
# Load the model
generator = DiffusionPipeline.from_pretrained(args.model).to("cuda")
# Generate image
image = generator(num_inference_steps=args.steps).images[0]
# Save the image with model name in the filename
output_filename = f"output_{args.model.split('/')[-1]}.png"
image.save(output_filename)
print(f"Image saved as {output_filename}")
```
python inference.py |