Text-to-Image
Diffusers
Safetensors
StableDiffusionPipeline
stable-diffusion
stable-diffusion-diffusers
textual_inversion
diffusers-training
Instructions to use aiwithi/Story_Generation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use aiwithi/Story_Generation with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stable-diffusion-v1-5/stable-diffusion-v1-5", dtype=torch.bfloat16, device_map="cuda") pipe.load_textual_inversion("aiwithi/Story_Generation") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Download diffusers/tests/models/autoencoders/test_models_vae_flax.py from aiwithi/Story_Generation: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/aiwithi/Story_Generation/resolve/main/diffusers/tests/models/autoencoders/test_models_vae_flax.py
- Command line
-
hf download hf://aiwithi/Story_Generation/diffusers/tests/models/autoencoders/test_models_vae_flax.py
-
curl -L -o test_models_vae_flax.py https://huggingface.co/aiwithi/Story_Generation/resolve/main/diffusers/tests/models/autoencoders/test_models_vae_flax.py
1.13 kB
| import unittest | |
| from diffusers import FlaxAutoencoderKL | |
| from diffusers.utils import is_flax_available | |
| from diffusers.utils.testing_utils import require_flax | |
| from ..test_modeling_common_flax import FlaxModelTesterMixin | |
| if is_flax_available(): | |
| import jax | |
| class FlaxAutoencoderKLTests(FlaxModelTesterMixin, unittest.TestCase): | |
| model_class = FlaxAutoencoderKL | |
| def dummy_input(self): | |
| batch_size = 4 | |
| num_channels = 3 | |
| sizes = (32, 32) | |
| prng_key = jax.random.PRNGKey(0) | |
| image = jax.random.uniform(prng_key, ((batch_size, num_channels) + sizes)) | |
| return {"sample": image, "prng_key": prng_key} | |
| def prepare_init_args_and_inputs_for_common(self): | |
| init_dict = { | |
| "block_out_channels": [32, 64], | |
| "in_channels": 3, | |
| "out_channels": 3, | |
| "down_block_types": ["DownEncoderBlock2D", "DownEncoderBlock2D"], | |
| "up_block_types": ["UpDecoderBlock2D", "UpDecoderBlock2D"], | |
| "latent_channels": 4, | |
| } | |
| inputs_dict = self.dummy_input | |
| return init_dict, inputs_dict | |