Text-to-Image
Diffusers
Safetensors
English
Chinese
QwenImage21Pipeline
sdnq
int4
uint4
image-generation
image-editing
apple-silicon
8-bit precision
Instructions to use ixim/Image21-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ixim/Image21-INT4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ixim/Image21-INT4", 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: 859 Bytes
9116984 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | import os
import unittest
from unittest.mock import patch
from scripts.upload import modelscope_access
class CachedGitOnly:
@staticmethod
def get_token():
return 'cached-git-credential-not-an-api-token'
@staticmethod
def get_cookies():
return None
class UploadAuthTests(unittest.TestCase):
def test_cached_git_credential_cannot_authorize_api_upload(self):
with patch.dict(os.environ, {}, clear=True):
with self.assertRaisesRegex(RuntimeError, 'API'):
modelscope_access(CachedGitOnly, 'iximbox')
def test_explicit_sdk_token_is_selected(self):
with patch.dict(os.environ, {'MODELSCOPE_API_TOKEN': 'test-sdk-token'}, clear=True):
self.assertEqual(modelscope_access(CachedGitOnly, 'iximbox'), 'test-sdk-token')
if __name__ == '__main__':
unittest.main()
|