@zodic/shared 0.0.335 → 0.0.336

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.
package/app/api/index.ts CHANGED
@@ -311,7 +311,7 @@ export const Api = (env: BackendBindings) => ({
311
311
  preprocessorId: net.preprocessorId,
312
312
  };
313
313
 
314
- if (net.preprocessorId === 100) {
314
+ if (net.preprocessorId == 100 || net.preprocessorId == 133) {
315
315
  return { ...baseNet, strengthType: net.strengthType };
316
316
  } else if (net.preprocessorId === 19) {
317
317
  return { ...baseNet, weight: net.weight };
@@ -347,7 +347,9 @@ export const Api = (env: BackendBindings) => ({
347
347
  }
348
348
  },
349
349
 
350
- generatePresignedUrl: async (extension: string): Promise<{
350
+ generatePresignedUrl: async (
351
+ extension: string
352
+ ): Promise<{
351
353
  id: string;
352
354
  fields: string;
353
355
  key: string;
@@ -358,14 +360,14 @@ export const Api = (env: BackendBindings) => ({
358
360
  Authorization: `Bearer ${env.LEONARDO_API_KEY}`,
359
361
  'Content-Type': 'application/json',
360
362
  };
361
-
363
+
362
364
  try {
363
365
  const response = await fetch(endpoint, {
364
366
  method: 'POST',
365
367
  headers,
366
368
  body: JSON.stringify({ extension }), // Include the extension in the request body
367
369
  });
368
-
370
+
369
371
  if (!response.ok) {
370
372
  const error = await response.json();
371
373
  console.error(
@@ -374,10 +376,10 @@ export const Api = (env: BackendBindings) => ({
374
376
  );
375
377
  throw new Error(`Leonardo API Error: ${response.status}`);
376
378
  }
377
-
378
- const data = await response.json() as any;
379
+
380
+ const data = (await response.json()) as any;
379
381
  const result = data.uploadInitImage;
380
-
382
+
381
383
  if (
382
384
  !result ||
383
385
  !result.id ||
@@ -388,7 +390,7 @@ export const Api = (env: BackendBindings) => ({
388
390
  console.error('❌ Invalid response from Leonardo API:', data);
389
391
  throw new Error('Invalid response structure from Leonardo API');
390
392
  }
391
-
393
+
392
394
  return {
393
395
  id: result.id,
394
396
  fields: result.fields,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zodic/shared",
3
- "version": "0.0.335",
3
+ "version": "0.0.336",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -416,8 +416,7 @@ export type ControlNetConfig =
416
416
  initImageId: string;
417
417
  initImageType: 'UPLOADED' | 'GENERATED';
418
418
  preprocessorId: 100;
419
- strengthType?: ControlNetStrenghtType;
420
- weight?: number;
419
+ strengthType: ControlNetStrenghtType;
421
420
  }
422
421
  | {
423
422
  initImageId: string;
@@ -429,8 +428,7 @@ export type ControlNetConfig =
429
428
  initImageId: string;
430
429
  initImageType: 'UPLOADED' | 'GENERATED';
431
430
  preprocessorId: 133;
432
- strengthType?: ControlNetStrenghtType;
433
- weight?: number;
431
+ strengthType: ControlNetStrenghtType;
434
432
  };
435
433
 
436
434
  export type PlacementObject = {