Skip to content

Commit 851bb2c

Browse files
committed
Trying hard, and failing, to get Text2Image working in Linux
1 parent 485cfcc commit 851bb2c

File tree

4 files changed

+32
-35
lines changed

4 files changed

+32
-35
lines changed

modulesettings.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -155,38 +155,6 @@
155155
}
156156
]
157157
}
158-
/*
159-
,{
160-
"Name": "Get Long Process Status",
161-
"Route": "text2image/get_command_status",
162-
"Method": "POST",
163-
"Command": "get_command_status",
164-
"MeshEnabled": false,
165-
"Description": "Gets the status of a long running command.",
166-
"Inputs": [
167-
{
168-
"Name": "command_id",
169-
"Type": "Text",
170-
"Description": "The id of the command to get the result for."
171-
}
172-
]
173-
},
174-
{
175-
"Name": "Get Long Process Status",
176-
"Route": "text2image/cancel_command",
177-
"Method": "POST",
178-
"Command": "cancel_command",
179-
"MeshEnabled": false,
180-
"Description": "Cancels a long running command.",
181-
"Inputs": [
182-
{
183-
"Name": "command_id",
184-
"Type": "Text",
185-
"Description": "The id of the command to be cancelled."
186-
}
187-
]
188-
}
189-
*/
190158
]
191159
}
192160
}

requirements.linux.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#! Python3.9
2+
3+
--extra-index-url https://download.pytorch.org/whl/cpu
4+
torch==2.1.2+cpu # Installing PyTorch, for Tensor computation and Deep neural networks
5+
6+
# https://github.com/huggingface/alignment-handbook/issues/94
7+
# huggingface_hub>=0.19.2
8+
9+
# "tokenizers>=0.11.1,!=0.11.3,<0.14 is required for a normal functioning of this module" https://stackoverflow.com/a/77702552
10+
# Except this fails.
11+
tokenizers>=0.11.1,!=0.11.3,<0.14
12+
13+
# transformers # Installing transformers for State-of-the-art machine Learning for JAX, PyTorch and TensorFlow
14+
# Solves: module 'torch.utils._pytree' has no attribute 'register_pytree_node' https://stackoverflow.com/a/78416003
15+
transformers==4.28.0 # Installing transformers for State-of-the-art machine Learning for JAX, PyTorch and TensorFlow
16+
17+
# https://pypi.org/project/optimum/
18+
# optimum[openvino, nncf] # Installing Optimum to allow OpenVINO and the Neural Network Compression Framework integration
19+
# optimum[openvino] # Installing Optimum to allow OpenVINO integration
20+
optimum[intel] # Installing Optimum to make the model happy
21+
diffusers[torch] # Installing Diffusers for state-of-the-art diffusion in PyTorch and JAX.
22+
23+
CodeProject-AI-SDK # Installing the CodeProject.AI SDK
24+
25+
# last line empty.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ optimum[openvino] # Installing Optimum to allow OpenVINO integrati
1010
diffusers[torch] # Installing Diffusers for state-of-the-art diffusion in PyTorch and JAX.
1111
transformers # Installing transformers for State-of-the-art machine Learning for JAX, PyTorch and TensorFlow
1212

13-
CodeProject-AI-SDK # Installing the CodeProject.AI SDK
13+
CodeProject-AI-SDK # Installing the CodeProject.AI SDK
1414

15-
# last line empty.
15+
# last line empty.

stable_diffusion_adapter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
import time
33
from typing import Dict
44

5+
# SetupTools replaces DistUtils, but if a package imports distutils before
6+
# setuptools then setuptools will chuck a wobbly. This is a prophylactic.
7+
import setuptools
8+
59
# Import CodeProject.AI SDK
610
from codeproject_ai_sdk import RequestData, ModuleOptions, ModuleRunner, JSON
711

@@ -230,7 +234,7 @@ def image_create_callback_cpu(self, step, tensor, latents):
230234
if not (self.current_step % self.skip_image_updates):
231235
"""
232236
try:
233-
# Note even ChatGPT can work out how to convert latents to images
237+
# Not even ChatGPT can work out how to convert latents to images
234238
# for a OVStableDiffusionPipeline object
235239
from PIL import Image
236240
images = self.pipeline.generate_images(latents)

0 commit comments

Comments
 (0)