@zodic/shared 0.0.108 → 0.0.110

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
- `Queuing image generation for concept: ${conceptSlug}, combination: ${combinationString}, language: ${language}`
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
- `Extracted planet signs: ${planet1} -> ${planet1Sign}, ${planet2} -> ${planet2Sign}, ${planet3} -> ${planet3Sign}`
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(`Requesting Leonardo AI image generation...`);
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
- `Leonardo AI image generation triggered for ${conceptSlug}:${combinationString}, tracking ID: ${generationId}`
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: string,
10
+ conceptSlug: Concept,
11
11
  combinationString: string,
12
12
  phase: ConceptPhase
13
13
  ) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.108",
3
+ "version": "0.0.110",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -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: '450076a1-c6bb-4877-8a0b-c0d3ba72fca7',
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: '450076a1-c6bb-4877-8a0b-c0d3ba72fca7',
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 = {
@@ -1,14 +1,17 @@
1
+ import { Concept } from "../types";
2
+
1
3
  export const mapConceptToPlanets = (
2
- conceptSlug: string,
4
+ conceptSlug: Concept,
3
5
  combination: string
4
6
  ): string => {
5
7
  const signs = combination.split('-');
6
8
 
7
9
  const conceptPlanetMapping: Record<string, string[]> = {
8
10
  crown: ['Sun', 'Ascendant', 'Moon'],
9
- scepter: ['Mercury', 'Venus', 'Mars'],
11
+ scepter: ['Mercury', 'Mars', 'Descendant'],
10
12
  amulet: ['Jupiter', 'Saturn', 'Chiron'],
11
- lantern: ['Uranus', 'Neptune', 'Pluto'],
13
+ ring: ['Venus', 'Lilith', 'Vertex'],
14
+ lantern: ['Pars Spiritus', 'Imum Coeli', 'Antivertex'],
12
15
  orb: ['North Node', 'Midheaven', 'Pars Fortuna'],
13
16
  };
14
17