File size: 1,865 Bytes
1472409 3dbe624 1472409 3b11cc0 1472409 7225e89 3dbe624 7225e89 0278ea6 1472409 |
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
---
library_name: diffusers
---
# Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
House plan sketches
#trained on:Frisby
## Model Details
```python
class TrainingConfig:
image_size = 192 # the generated image resolution
train_batch_size = 8
eval_batch_size = 8 # how many images to sample during evaluation
num_epochs = 200
gradient_accumulation_steps = 1
learning_rate = 1e-4
lr_warmup_steps = 500
save_image_epochs = 10
save_model_epochs = 30
mixed_precision = 'fp16' # `no` for float32, `fp16` for automatic mixed precision
output_dir = 'ddpm-butterflies-128' # the model namy locally and on the HF Hub
push_to_hub = False # whether to upload the saved model to the HF Hub
hub_private_repo = False
overwrite_output_dir = False # overwrite the old model when re-running the notebook
seed = 0
config = TrainingConfig()
```
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 --model="uisikdag/ddpm-robin-plus-old" --steps 1000
|