Instructions to use 43ntropy/NEvo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use 43ntropy/NEvo with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("43ntropy/NEvo", 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
File size: 782 Bytes
1e2bb2f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any
class TextToImageGenerator(ABC):
@abstractmethod
def generate(self, prompts: list[str], *, generator: Any | None = None, **kwargs) -> list[Any]:
...
class ImageToVideoGenerator(ABC):
@abstractmethod
def generate(self, image: Any, prompt: str, *, generator: Any | None = None, **kwargs) -> Any:
...
def generate_batch(self, images: list[Any], prompts: list[str], *, generators: list[Any] | None = None, **kwargs) -> list[Any]:
generators = generators or [None] * len(images)
return [
self.generate(image, prompt, generator=gen, **kwargs)
for image, prompt, gen in zip(images, prompts, generators)
]
|