autonomous-app 0.3.40__py3-none-any.whl → 0.3.41__py3-none-any.whl
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.
- autonomous/__init__.py +1 -1
- autonomous/ai/imageagent.py +1 -3
- autonomous/ai/models/local_model.py +23 -23
- {autonomous_app-0.3.40.dist-info → autonomous_app-0.3.41.dist-info}/METADATA +1 -1
- {autonomous_app-0.3.40.dist-info → autonomous_app-0.3.41.dist-info}/RECORD +7 -7
- {autonomous_app-0.3.40.dist-info → autonomous_app-0.3.41.dist-info}/WHEEL +0 -0
- {autonomous_app-0.3.40.dist-info → autonomous_app-0.3.41.dist-info}/top_level.txt +0 -0
autonomous/__init__.py
CHANGED
autonomous/ai/imageagent.py
CHANGED
|
@@ -21,8 +21,7 @@ class ImageAgent(BaseAgent):
|
|
|
21
21
|
self,
|
|
22
22
|
prompt,
|
|
23
23
|
negative_prompt="",
|
|
24
|
-
aspect_ratio="
|
|
25
|
-
image_size="2K",
|
|
24
|
+
aspect_ratio="2KPortrait",
|
|
26
25
|
files=None,
|
|
27
26
|
):
|
|
28
27
|
return self.get_client(
|
|
@@ -31,6 +30,5 @@ class ImageAgent(BaseAgent):
|
|
|
31
30
|
prompt,
|
|
32
31
|
aspect_ratio=aspect_ratio,
|
|
33
32
|
negative_prompt=negative_prompt,
|
|
34
|
-
image_size=image_size,
|
|
35
33
|
files=files,
|
|
36
34
|
)
|
|
@@ -268,7 +268,9 @@ class LocalAIModel(AutoModel):
|
|
|
268
268
|
"4:3": (1152, 896),
|
|
269
269
|
"16:9": (1216, 832),
|
|
270
270
|
"2K": (2048, 1080),
|
|
271
|
+
"2KPortrait": (1080, 2048),
|
|
271
272
|
"4K": (3840, 2160),
|
|
273
|
+
"4KPortrait": (2160, 3840),
|
|
272
274
|
"9:16": (832, 1216),
|
|
273
275
|
"3:2": (1216, 832),
|
|
274
276
|
"2:3": (832, 1216),
|
|
@@ -277,25 +279,20 @@ class LocalAIModel(AutoModel):
|
|
|
277
279
|
return resolutions.get(aspect_ratio, (1024, 1024))
|
|
278
280
|
|
|
279
281
|
def generate_image(
|
|
280
|
-
self,
|
|
281
|
-
prompt,
|
|
282
|
-
negative_prompt="",
|
|
283
|
-
files=None,
|
|
284
|
-
aspect_ratio="3:4",
|
|
285
|
-
image_size="2K",
|
|
282
|
+
self, prompt, negative_prompt="", files=None, aspect_ratio="2KPortrait"
|
|
286
283
|
):
|
|
287
|
-
# 1. CLIP Token Limit Fix (Auto-Summarize)
|
|
288
|
-
if len(prompt) >
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
284
|
+
# # 1. CLIP Token Limit Fix (Auto-Summarize)
|
|
285
|
+
# if len(prompt) > 800:
|
|
286
|
+
# log("⚠️ Prompt exceeds CLIP limit. rewriting...", _print=True)
|
|
287
|
+
# summary_instruction = (
|
|
288
|
+
# "Convert the description into a comma-separated Stable Diffusion prompt. "
|
|
289
|
+
# "Keep visual elements and style. Under 50 words."
|
|
290
|
+
# )
|
|
291
|
+
# new_prompt = self.generate_text(
|
|
292
|
+
# message=prompt, additional_instructions=summary_instruction, context={}
|
|
293
|
+
# )
|
|
294
|
+
# if new_prompt and len(new_prompt) > 10:
|
|
295
|
+
# prompt = new_prompt
|
|
299
296
|
|
|
300
297
|
# 2. Resolution Calculation
|
|
301
298
|
width, height = self._get_dimensions(aspect_ratio)
|
|
@@ -312,25 +309,28 @@ class LocalAIModel(AutoModel):
|
|
|
312
309
|
}
|
|
313
310
|
|
|
314
311
|
try:
|
|
315
|
-
# Handle Files (
|
|
316
|
-
|
|
312
|
+
# Handle Files (Corrected List Logic)
|
|
313
|
+
# requests.post expects a list of tuples for multiple files with same key
|
|
314
|
+
files_list = []
|
|
317
315
|
if files and isinstance(files, dict):
|
|
318
316
|
for fn, f_bytes in files.items():
|
|
319
317
|
if isinstance(f_bytes, bytes):
|
|
320
318
|
file_obj = io.BytesIO(f_bytes)
|
|
321
319
|
else:
|
|
322
320
|
file_obj = f_bytes
|
|
323
|
-
|
|
321
|
+
# Appending to list instead of overwriting dict key
|
|
322
|
+
files_list.append(("files", (fn, file_obj, "image/png")))
|
|
324
323
|
|
|
325
324
|
# Send Request
|
|
326
|
-
if
|
|
325
|
+
if files_list:
|
|
327
326
|
response = requests.post(
|
|
328
|
-
f"{self._media_url}/generate-image", data=data, files=
|
|
327
|
+
f"{self._media_url}/generate-image", data=data, files=files_list
|
|
329
328
|
)
|
|
330
329
|
else:
|
|
331
330
|
response = requests.post(f"{self._media_url}/generate-image", data=data)
|
|
332
331
|
|
|
333
332
|
response.raise_for_status()
|
|
333
|
+
log("==== LocalAI Image Payload ====", data, _print=True)
|
|
334
334
|
return response.content
|
|
335
335
|
|
|
336
336
|
except Exception as e:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autonomous-app
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.41
|
|
4
4
|
Summary: Containerized application framework built on Flask with additional libraries and tools for rapid development of web applications.
|
|
5
5
|
Author-email: Steven A Moore <samoore@binghamton.edu>
|
|
6
6
|
Project-URL: homepage, https://github.com/Sallenmoore/autonomous
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
autonomous/__init__.py,sha256=
|
|
1
|
+
autonomous/__init__.py,sha256=2Py6rnpUfu4t8c9Y9n3oQLD2-RGCbghqEkVltb7JTpw,95
|
|
2
2
|
autonomous/cli.py,sha256=z4AaGeWNW_uBLFAHng0J_lfS9v3fXemK1PeT85u4Eo4,42
|
|
3
3
|
autonomous/logger.py,sha256=NQtgEaTWNAWfLSgqSP7ksXj1GpOuCgoUV711kSMm-WA,2022
|
|
4
4
|
autonomous/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
autonomous/ai/audioagent.py,sha256=aZ25eEdze8S060-a4S0k319tgyl2aDTUa8dJu07mXn0,1092
|
|
6
6
|
autonomous/ai/baseagent.py,sha256=icOPygr1NdH64u1ZYbwHHywYIY1ZtaLY9HtfNmUbx4k,4702
|
|
7
|
-
autonomous/ai/imageagent.py,sha256=
|
|
7
|
+
autonomous/ai/imageagent.py,sha256=5eb4irUcWOD1HnquHX3jOTjOsed5Yn98rxSol84Lf18,902
|
|
8
8
|
autonomous/ai/jsonagent.py,sha256=DNfZHMVCfc5nrkWJm2OebTYDkBwm_ZCeVWGIFGjB_Cg,1208
|
|
9
9
|
autonomous/ai/textagent.py,sha256=0y2Hvb9pup1OnsA51hGPcD8yllZOZtztDLQvCNYABaw,1043
|
|
10
10
|
autonomous/ai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
autonomous/ai/models/gemini.py,sha256=eu48gywNFpUFaqBt-4MFX2oRM5IED9rUTgtavM_HRG0,14468
|
|
12
|
-
autonomous/ai/models/local_model.py,sha256=
|
|
12
|
+
autonomous/ai/models/local_model.py,sha256=HjHDZqmdhlT29e5Q7GXNbZYbM9GVNiSzEJyBDpXWxtU,12431
|
|
13
13
|
autonomous/apis/version_control/GHCallbacks.py,sha256=AyiUlYfV5JePi11GVyqYyXoj5UTbPKzS-HRRI94rjJo,1069
|
|
14
14
|
autonomous/apis/version_control/GHOrganization.py,sha256=mi2livdsGurKiifbvuLwiFbdDzL77IlEfhwEa-tG77I,1155
|
|
15
15
|
autonomous/apis/version_control/GHRepo.py,sha256=hTFHMkxSbSlVELfh8S6mq6ijkIKPRQO-Q5775ZjRKD4,4622
|
|
@@ -55,7 +55,7 @@ autonomous/taskrunner/__init__.py,sha256=ughX-QfWBas5W3aB2SiF887SWJ3Dzc2X43Yxtmp
|
|
|
55
55
|
autonomous/taskrunner/autotasks.py,sha256=2zRaqHYqfdlgC_BQm6B6D2svN1ukyWeJJHwweZFHVoo,2616
|
|
56
56
|
autonomous/taskrunner/task_router.py,sha256=W09HtRUuhwlnGxM5w4l6Hzw6mfS6L4ljWiMzD3ZVFeU,601
|
|
57
57
|
autonomous/utils/markdown.py,sha256=tf8vlHARiQO1X_aGbqlYozzP_TbdiDRT9EEP6aFRQo0,2153
|
|
58
|
-
autonomous_app-0.3.
|
|
59
|
-
autonomous_app-0.3.
|
|
60
|
-
autonomous_app-0.3.
|
|
61
|
-
autonomous_app-0.3.
|
|
58
|
+
autonomous_app-0.3.41.dist-info/METADATA,sha256=bF72uTuECc-BhEP0w7uDgm7gqnLsx-cf4eIH1uIxJhY,3024
|
|
59
|
+
autonomous_app-0.3.41.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
60
|
+
autonomous_app-0.3.41.dist-info/top_level.txt,sha256=ZyxWWDdbvZekF3UFunxl4BQsVDb_FOW3eTn0vun_jb4,11
|
|
61
|
+
autonomous_app-0.3.41.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|