@zodic/shared 0.0.108 → 0.0.109
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.
|
@@ -171,7 +171,7 @@ export class ConceptService {
|
|
|
171
171
|
|
|
172
172
|
const kvKey = buildConceptKVKey(language, conceptSlug, combinationString);
|
|
173
173
|
console.log(
|
|
174
|
-
|
|
174
|
+
`🚀 Queuing image generation for concept: ${conceptSlug}, combination: ${combinationString}, language: ${language}`
|
|
175
175
|
);
|
|
176
176
|
|
|
177
177
|
const concept = await this.getKVConcept(kvKey);
|
|
@@ -211,7 +211,7 @@ export class ConceptService {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
console.log(
|
|
214
|
-
|
|
214
|
+
`🔹 Extracted planet signs: ${planet1} -> ${planet1Sign}, ${planet2} -> ${planet2Sign}, ${planet3} -> ${planet3Sign}`
|
|
215
215
|
);
|
|
216
216
|
|
|
217
217
|
// 🔍 Ensure Concept Combination exists
|
|
@@ -251,21 +251,34 @@ export class ConceptService {
|
|
|
251
251
|
`✅ Using conceptCombinationId: ${conceptCombinationId} for ${conceptSlug}:${combinationString}`
|
|
252
252
|
);
|
|
253
253
|
|
|
254
|
-
console.log(
|
|
254
|
+
console.log(`🎨 Requesting Leonardo AI image generation...`);
|
|
255
|
+
|
|
256
|
+
// 🔍 Check if there is a valid init image
|
|
257
|
+
const initImageId = leonardoInitImages.concepts[conceptSlug]?.imageId;
|
|
258
|
+
const controlNets = initImageId
|
|
259
|
+
? ([
|
|
260
|
+
{
|
|
261
|
+
initImageId,
|
|
262
|
+
initImageType: 'UPLOADED',
|
|
263
|
+
preprocessorId: 100, // Content reference
|
|
264
|
+
strengthType: 'Low',
|
|
265
|
+
},
|
|
266
|
+
] as Array<{
|
|
267
|
+
initImageId: string;
|
|
268
|
+
initImageType: 'UPLOADED' | 'GENERATED';
|
|
269
|
+
preprocessorId: number;
|
|
270
|
+
strengthType: 'Low' | 'Mid' | 'High';
|
|
271
|
+
}>)
|
|
272
|
+
: [];
|
|
273
|
+
|
|
274
|
+
// 🎨 Call Leonardo with or without ControlNet
|
|
255
275
|
const leonardoResponse = await this.context
|
|
256
276
|
.api()
|
|
257
277
|
.callLeonardo.generateImage({
|
|
258
278
|
prompt: concept.leonardoPrompt,
|
|
259
279
|
width,
|
|
260
280
|
height,
|
|
261
|
-
controlNets:
|
|
262
|
-
{
|
|
263
|
-
initImageId: leonardoInitImages.concepts[conceptSlug].imageId,
|
|
264
|
-
initImageType: 'UPLOADED',
|
|
265
|
-
preprocessorId: 100, // content reference
|
|
266
|
-
strengthType: 'Low',
|
|
267
|
-
},
|
|
268
|
-
],
|
|
281
|
+
...(controlNets.length > 0 ? { controlNets } : {}),
|
|
269
282
|
});
|
|
270
283
|
|
|
271
284
|
const generationId = leonardoResponse?.sdGenerationJob?.generationId;
|
|
@@ -290,7 +303,7 @@ export class ConceptService {
|
|
|
290
303
|
);
|
|
291
304
|
|
|
292
305
|
console.log(
|
|
293
|
-
|
|
306
|
+
`🎨 Leonardo AI image generation triggered for ${conceptSlug}:${combinationString}, tracking ID: ${generationId}`
|
|
294
307
|
);
|
|
295
308
|
}
|
|
296
309
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { inject, injectable } from 'inversify';
|
|
2
|
-
import { ConceptPhase } from '../../types';
|
|
2
|
+
import { Concept, ConceptPhase } from '../../types';
|
|
3
3
|
import { ConceptService } from '../services/ConceptService';
|
|
4
4
|
|
|
5
5
|
@injectable()
|
|
@@ -7,7 +7,7 @@ export class ConceptWorkflow {
|
|
|
7
7
|
constructor(@inject(ConceptService) private conceptService: ConceptService) {}
|
|
8
8
|
|
|
9
9
|
async processSingle(
|
|
10
|
-
conceptSlug:
|
|
10
|
+
conceptSlug: Concept,
|
|
11
11
|
combinationString: string,
|
|
12
12
|
phase: ConceptPhase
|
|
13
13
|
) {
|
package/package.json
CHANGED
package/utils/initImages.ts
CHANGED
|
@@ -13,14 +13,12 @@ export const leonardoInitImages: LeonardoInitImages = {
|
|
|
13
13
|
'https://cdn.leonardo.ai/users/b117a933-e5c9-45b2-96aa-4b619c2d74ba/initImages/744169ef-3db4-416d-86dd-9bd814e33432.jpg',
|
|
14
14
|
},
|
|
15
15
|
amulet: {
|
|
16
|
-
imageId:
|
|
17
|
-
imageUrl:
|
|
18
|
-
'https://cdn.leonardo.ai/users/b117a933-e5c9-45b2-96aa-4b619c2d74ba/initImages/450076a1-c6bb-4877-8a0b-c0d3ba72fca7.jpg',
|
|
16
|
+
imageId: null,
|
|
17
|
+
imageUrl: null,
|
|
19
18
|
},
|
|
20
19
|
lantern: {
|
|
21
|
-
imageId:
|
|
22
|
-
imageUrl:
|
|
23
|
-
'https://cdn.leonardo.ai/users/b117a933-e5c9-45b2-96aa-4b619c2d74ba/initImages/450076a1-c6bb-4877-8a0b-c0d3ba72fca7.jpg',
|
|
20
|
+
imageId: null,
|
|
21
|
+
imageUrl: null,
|
|
24
22
|
},
|
|
25
23
|
orb: {
|
|
26
24
|
imageId: '450076a1-c6bb-4877-8a0b-c0d3ba72fca7',
|
|
@@ -37,7 +35,7 @@ export const leonardoInitImages: LeonardoInitImages = {
|
|
|
37
35
|
|
|
38
36
|
type ConceptsInitImages = Record<
|
|
39
37
|
Concept,
|
|
40
|
-
{ imageId: string; imageUrl: string }
|
|
38
|
+
{ imageId: string | null; imageUrl: string | null }
|
|
41
39
|
>;
|
|
42
40
|
|
|
43
41
|
type LeonardoInitImages = {
|