Update README.md
Browse files
README.md
CHANGED
|
@@ -12,15 +12,60 @@ tags:
|
|
| 12 |
inference: true
|
| 13 |
---
|
| 14 |
|
| 15 |
-
# DreamBooth -
|
| 16 |
|
| 17 |
-
|
| 18 |
-
You can find some example images in the following.
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |

|
| 22 |

|
| 23 |

|
| 24 |
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
inference: true
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# DreamBooth - Bored Ape Yacht Club
|
| 16 |
|
| 17 |
+
## Model Description
|
|
|
|
| 18 |
|
| 19 |
+
This DreamBooth model is an exquisite derivative of `runwayml/stable-diffusion-v1-5`, fine-tuned with an engaging emphasis on the Bored Ape Yacht Club (BAYC) NFT collection. The model's weights were meticulously honed using photos from BAYC NFTs, leveraging the innovative [DreamBooth](https://dreambooth.github.io/) technology to curate a unique, text-to-image synthesis experience.
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
### Training
|
| 23 |
+
|
| 24 |
+
Images instrumental in the model's training were generously sourced from the Covalent API, specifically via this [endpoint](https://www.covalenthq.com/docs/api/nft/get-nft-token-ids-for-contract-with-metadata/).
|
| 25 |
+
|
| 26 |
+
### Inference
|
| 27 |
+
|
| 28 |
+
Inference has been meticulously optimized, allowing for the generation of captivating, original, and unique images that resonate with the Bored Ape Yacht Club collection. This facilitates a vivid exploration of creativity, enabling the synthesis of images that seamlessly align with the distinctive aesthetics of Bored Ape NFTs.
|
| 29 |
|
| 30 |

|
| 31 |

|
| 32 |

|
| 33 |
|
| 34 |
|
| 35 |
+
## Usage
|
| 36 |
+
|
| 37 |
+
Here’s a basic example of how you can wield this model for generating images:
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import torch
|
| 41 |
+
from diffusers import StableDiffusionPipeline, DDIMScheduler
|
| 42 |
+
from transformers import CLIPTextModel
|
| 43 |
+
import numpy as np
|
| 44 |
+
|
| 45 |
+
model_id = "runwayml/stable-diffusion-v1-5"
|
| 46 |
+
|
| 47 |
+
unet = UNet2DConditionModel.from_pretrained("ckandemir/bayc-diffusion", subfolder="unet")
|
| 48 |
+
text_encoder = CLIPTextModel.from_pretrained("ckandemir/bayc-diffusion",subfolder="text_encoder")
|
| 49 |
+
|
| 50 |
+
pipeline = StableDiffusionPipeline.from_pretrained(
|
| 51 |
+
model_id, unet=unet, text_encoder=text_encoder, dtype=torch.float16, use_safetensors=True
|
| 52 |
+
).to('cuda')
|
| 53 |
+
pipeline.scheduler = DDIMScheduler.from_config(pipeline.scheduler.config)
|
| 54 |
+
|
| 55 |
+
prompt = ["a spiderman bayc nft"]
|
| 56 |
+
neg_prompt = ["realistic,disfigured face,eye patch,disfigured eyes, disfigured, deformed,bad anatomy"] * len(prompt)
|
| 57 |
+
|
| 58 |
+
# Other parameters like num_samples, guidance_scale, etc., are defined here.
|
| 59 |
+
|
| 60 |
+
with autocast("cuda"), torch.inference_mode():
|
| 61 |
+
imgs = pipeline(
|
| 62 |
+
# Parameters like prompt, negative_prompt, etc., are passed here.
|
| 63 |
+
).images
|
| 64 |
+
|
| 65 |
+
for img in imgs:
|
| 66 |
+
display(img)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
## Optimization
|
| 70 |
+
Results can be further enhanced and refined through meticulous fine-tuning and adept modification of training parameters, unlocking an even broader spectrum of creativity and artistic expression.
|
| 71 |
+
|