Instructions to use not-pegasus/IMAGE_MODAL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use not-pegasus/IMAGE_MODAL with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("not-pegasus/IMAGE_MODAL", 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
| from __future__ import annotations | |
| import types | |
| from abc import ABCMeta, abstractmethod | |
| from collections.abc import AsyncGenerator, Callable, Coroutine, Iterable | |
| from typing import Any, TypeVar | |
| _T = TypeVar("_T") | |
| class TestRunner(metaclass=ABCMeta): | |
| """ | |
| Encapsulates a running event loop. Every call made through this object will use the | |
| same event loop. | |
| """ | |
| def __enter__(self) -> TestRunner: | |
| return self | |
| def __exit__( | |
| self, | |
| exc_type: type[BaseException] | None, | |
| exc_val: BaseException | None, | |
| exc_tb: types.TracebackType | None, | |
| ) -> bool | None: ... | |
| def run_asyncgen_fixture( | |
| self, | |
| fixture_func: Callable[..., AsyncGenerator[_T, Any]], | |
| kwargs: dict[str, Any], | |
| ) -> Iterable[_T]: | |
| """ | |
| Run an async generator fixture. | |
| :param fixture_func: the fixture function | |
| :param kwargs: keyword arguments to call the fixture function with | |
| :return: an iterator yielding the value yielded from the async generator | |
| """ | |
| def run_fixture( | |
| self, | |
| fixture_func: Callable[..., Coroutine[Any, Any, _T]], | |
| kwargs: dict[str, Any], | |
| ) -> _T: | |
| """ | |
| Run an async fixture. | |
| :param fixture_func: the fixture function | |
| :param kwargs: keyword arguments to call the fixture function with | |
| :return: the return value of the fixture function | |
| """ | |
| def run_test( | |
| self, test_func: Callable[..., Coroutine[Any, Any, Any]], kwargs: dict[str, Any] | |
| ) -> None: | |
| """ | |
| Run an async test function. | |
| :param test_func: the test function | |
| :param kwargs: keyword arguments to call the test function with | |
| """ | |