ai-simple-engine-runtime-diffusers 0.0.3__tar.gz → 0.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/PKG-INFO +3 -3
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/pyproject.toml +3 -3
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/diffusers_latent_diffusion_model_executor.py +18 -3
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/noise/pytorch_noise_generator.py +1 -1
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/scheduler/diffusers_scheduler.py +11 -6
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/LICENSE +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/README.md +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/noise/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/prompt_embeddings/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/prompt_embeddings/prompt_embeddings.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/text_encoder_model_executor_abstract.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/unet_model_executor_abstract.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/executor/vae_model_executor_abstract.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/loader/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/loader/latent_diffusion_model_loader.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/runtime/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/runtime/diffusers_latent_diffusion_model.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/runtime/utils.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/scheduler/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/scheduler/registry/__init__.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/scheduler/registry/diffusers_scheduler_registry.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/models/scheduler/utils.py +0 -0
- {ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/src/ai_simple_engine_runtime_diffusers/plugin.py +0 -0
{ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ai-simple-engine-runtime-diffusers
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.5
|
|
4
4
|
Summary: AI Simple Engine Runtime Diffusers Module
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: danialcala94
|
|
@@ -9,9 +9,9 @@ Requires-Python: >=3.10,<3.12
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Requires-Dist: ai-simple-engine (>=0.2.
|
|
12
|
+
Requires-Dist: ai-simple-engine (>=0.2.9,<1.0.0)
|
|
13
13
|
Requires-Dist: ai-simple-engine-common (>=0.0.3,<1.0.0)
|
|
14
|
-
Requires-Dist: ai-simple-engine-diffusion (>=0.0.
|
|
14
|
+
Requires-Dist: ai-simple-engine-diffusion (>=0.0.6,<1.0.0)
|
|
15
15
|
Requires-Dist: diffusers (>=0.38.0,<9999.0.0)
|
|
16
16
|
Requires-Dist: transformers (>=5.13.0,<9999.0.0)
|
|
17
17
|
Description-Content-Type: text/markdown
|
{ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/pyproject.toml
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "ai-simple-engine-runtime-diffusers"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.5"
|
|
4
4
|
description = "AI Simple Engine Runtime Diffusers Module"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "danialcala94", email = "danielalcalavalera@gmail.com"}
|
|
@@ -10,9 +10,9 @@ requires-python = ">=3.10,<3.12"
|
|
|
10
10
|
|
|
11
11
|
[tool.poetry.dependencies]
|
|
12
12
|
# Mandatory
|
|
13
|
-
ai-simple-engine = { version = ">=0.2.
|
|
13
|
+
ai-simple-engine = { version = ">=0.2.9,<1.0.0", optional = false }
|
|
14
14
|
ai-simple-engine-common = { version = ">=0.0.3,<1.0.0", optional = false }
|
|
15
|
-
ai-simple-engine-diffusion = { version = ">=0.0.
|
|
15
|
+
ai-simple-engine-diffusion = { version = ">=0.0.6,<1.0.0", optional = false }
|
|
16
16
|
transformers = { version = ">=5.13.0,<9999.0.0", optional = false }
|
|
17
17
|
diffusers = { version = ">=0.38.0,<9999.0.0", optional = false }
|
|
18
18
|
# Optional
|
|
@@ -26,7 +26,7 @@ class DiffusersLatentDiffusionModelExecutor (
|
|
|
26
26
|
self,
|
|
27
27
|
context: ExecutionContext,
|
|
28
28
|
model: LoadedModel,
|
|
29
|
-
):
|
|
29
|
+
) -> DiffusersScheduler:
|
|
30
30
|
scheduler_registry = context.services.get(DiffusersSchedulerRegistry)
|
|
31
31
|
|
|
32
32
|
scheduler_class = scheduler_registry.resolve(model.info.scheduler.identifier)
|
|
@@ -47,7 +47,7 @@ class DiffusersLatentDiffusionModelExecutor (
|
|
|
47
47
|
embeddings: PromptEmbeddings,
|
|
48
48
|
timestep,
|
|
49
49
|
guidance_scale
|
|
50
|
-
):
|
|
50
|
+
) -> torch.Tensor:
|
|
51
51
|
runtime_model = model.instance
|
|
52
52
|
unet = runtime_model.unet
|
|
53
53
|
latent_input = torch.cat([latents, latents])
|
|
@@ -112,20 +112,35 @@ class DiffusersLatentDiffusionModelExecutor (
|
|
|
112
112
|
*,
|
|
113
113
|
model: LoadedModel,
|
|
114
114
|
latents
|
|
115
|
-
) ->
|
|
115
|
+
) -> torch.Tensor:
|
|
116
116
|
runtime_model = model.instance
|
|
117
117
|
|
|
118
118
|
vae = runtime_model.vae
|
|
119
119
|
|
|
120
|
+
# Scale based on the vae (mandatory)
|
|
120
121
|
latents = latents / vae.config.scaling_factor
|
|
121
122
|
|
|
123
|
+
# Decode the image (mandatory)
|
|
122
124
|
image = vae.decode(latents).sample
|
|
123
125
|
"""
|
|
124
126
|
TODO: I don't know if this must be done always
|
|
125
127
|
or depending or what, but I should pay attention
|
|
126
128
|
and refactor it.
|
|
127
129
|
"""
|
|
130
|
+
|
|
131
|
+
"""
|
|
132
|
+
The VAE of Stable Diffusion return in the [-1, 1]
|
|
133
|
+
so we need to transform to [0, 1]. This is
|
|
134
|
+
specific from the Stable Diffusion.
|
|
135
|
+
"""
|
|
128
136
|
image = (image / 2 + 0.5).clamp(0, 1)
|
|
137
|
+
|
|
138
|
+
return image
|
|
139
|
+
|
|
140
|
+
"""
|
|
141
|
+
TODO: This is to make the image ready be read as a
|
|
142
|
+
real image and should be done here.
|
|
143
|
+
"""
|
|
129
144
|
image = image.cpu().permute(0, 2, 3, 1).float().detach().numpy()
|
|
130
145
|
image = Image(image)
|
|
131
146
|
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class DiffusersScheduler(
|
|
5
|
-
Scheduler
|
|
6
|
-
):
|
|
1
|
+
class DiffusersScheduler:
|
|
7
2
|
|
|
8
3
|
def __init__(
|
|
9
4
|
self,
|
|
@@ -11,6 +6,16 @@ class DiffusersScheduler(
|
|
|
11
6
|
):
|
|
12
7
|
self._scheduler = scheduler
|
|
13
8
|
|
|
9
|
+
@property
|
|
10
|
+
def init_noise_sigma(
|
|
11
|
+
self
|
|
12
|
+
):
|
|
13
|
+
"""
|
|
14
|
+
The `gamma` that must be used when starting
|
|
15
|
+
to create the noise.
|
|
16
|
+
"""
|
|
17
|
+
return self._scheduler.init_noise_sigma
|
|
18
|
+
|
|
14
19
|
@property
|
|
15
20
|
def timesteps(
|
|
16
21
|
self
|
{ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/LICENSE
RENAMED
|
File without changes
|
{ai_simple_engine_runtime_diffusers-0.0.3 → ai_simple_engine_runtime_diffusers-0.0.5}/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|