Diffusers
English
stable-diffusion
stable-diffusion-diffusers
inpainting
art
artistic
anime
absolute-realism
Instructions to use diffusers/tools with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers/tools with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers/tools", 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
| #!/usr/bin/env python3 | |
| import json | |
| import sys | |
| import numpy as np | |
| from collections import Counter | |
| import matplotlib as mpl | |
| import matplotlib.pyplot as plt | |
| files = sys.argv[1:] | |
| def retrieve_day_to_num_signups(file): | |
| with open(file, "r") as f: | |
| json_file = json.load(f) | |
| list_of_days = [x["time"].split("T")[0] for x in json_file] | |
| return Counter(list_of_days) | |
| files = {f.split()[0].split("user-access-report-")[-1]: f for f in files} | |
| counters = {file: retrieve_day_to_num_signups(path) for file, path in files.items()} | |
| total_counters = {file: np.cumsum(list(counters[file].values())) for file in files.keys()} | |
| max_size = max([c.shape[0] for c in list(total_counters.values())]) | |
| time_axis = np.arange(0, max_size) | |
| plot_counters = {} | |
| for k, v in total_counters.items(): | |
| plot_counters[k] = np.zeros(max_size, dtype=np.int32) | |
| if not v.shape[0] == max_size: | |
| plot_counters[k][-v.shape[0]:] = v | |
| else: | |
| plot_counters[k] = v | |
| fig, ax = plt.subplots() | |
| for file in files.keys(): | |
| ax.plot(time_axis, plot_counters[file], label=file) | |
| ax.set_xlabel("day since launch (on 23/08)") | |
| ax.set_ylabel("number of requsets") | |
| ax.set_title("Acces requests comparision") | |
| ax.legend() | |
| plt.savefig("access_requests.png") | |