Instructions to use jadechoghari/mar with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use jadechoghari/mar with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("jadechoghari/mar", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Update diffloss.py
Browse files- diffloss.py +7 -7
diffloss.py
CHANGED
|
@@ -96,15 +96,15 @@ class TimestepEmbedder(nn.Module):
|
|
| 96 |
# t_emb = self.mlp(t_freq)
|
| 97 |
# return t_emb
|
| 98 |
def forward(self, t):
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
t_freq = self.timestep_embedding(t, self.frequency_embedding_size)
|
| 102 |
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
return t_emb
|
| 108 |
|
| 109 |
|
| 110 |
class ResBlock(nn.Module):
|
|
|
|
| 96 |
# t_emb = self.mlp(t_freq)
|
| 97 |
# return t_emb
|
| 98 |
def forward(self, t):
|
| 99 |
+
t = t.to(self.mlp.weight.device)
|
|
|
|
|
|
|
| 100 |
|
| 101 |
+
t_freq = self.timestep_embedding(t, self.frequency_embedding_size)
|
| 102 |
+
|
| 103 |
+
t_freq = t_freq.to(self.mlp.weight.device)
|
| 104 |
+
|
| 105 |
+
t_emb = self.mlp(t_freq)
|
| 106 |
|
| 107 |
+
return t_emb
|
|
|
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
class ResBlock(nn.Module):
|