Instructions to use 8clabs/sketch-model-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use 8clabs/sketch-model-3 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("8clabs/sketch-model-3", torch_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
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 788 Bytes
dec981f | 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 | from time import perf_counter
class SequentialTimer:
def __init__(self, make_print=False):
self.timings = []
self.make_print = make_print
def time(self, message: str):
if self.make_print:
print(message)
self.timings.append((perf_counter(), message))
def to_str(self) -> str:
s = ""
if len(self.timings) <= 1:
s = "No timings"
return s
t0 = self.timings[0][0]
for ((t1, m1), (t2, _)) in zip(self.timings, self.timings[1:]):
s += f"TIME: step: {t2 - t1:06.3f} | cum {t2 - t0:06.3f} - {m1}\n"
s += f"ALL TIME: {self.timings[-1][0] - self.timings[0][0]:07.3f}\n"
return s
def printall(self):
print(self.to_str()) |