@runware/sdk-js 1.1.20 → 1.1.21
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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -2
- package/dist/index.d.ts +96 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +126 -0
package/readme.md
CHANGED
|
@@ -513,6 +513,125 @@ export interface IImage {
|
|
|
513
513
|
seed?: number;
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
### Model Search
|
|
521
|
+
|
|
522
|
+
```js
|
|
523
|
+
|
|
524
|
+
const runware = new Runware({ apiKey: "API_KEY" });
|
|
525
|
+
|
|
526
|
+
const modelSearch = await runware.modelSearch({
|
|
527
|
+
search: string;
|
|
528
|
+
tags?: string[];
|
|
529
|
+
category?: "checkpoint" | "lora" | "controlnet";
|
|
530
|
+
architecture?: EModelArchitecture;
|
|
531
|
+
limit?: number;
|
|
532
|
+
offset?: number;
|
|
533
|
+
owned?: boolean;
|
|
534
|
+
featured: boolean;
|
|
535
|
+
type: string;
|
|
536
|
+
conditioning: string;
|
|
537
|
+
private: boolean;
|
|
538
|
+
customTaskUUID?: string;
|
|
539
|
+
retry?: number;
|
|
540
|
+
})
|
|
541
|
+
console.log(modelSearch)
|
|
542
|
+
|
|
543
|
+
export type TModelSearchResponse = {
|
|
544
|
+
results: TModel[];
|
|
545
|
+
taskUUID: string;
|
|
546
|
+
taskType: string;
|
|
547
|
+
totalResults: number;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
export type TModel = {
|
|
551
|
+
name: string;
|
|
552
|
+
air: string;
|
|
553
|
+
downloadUrl: string;
|
|
554
|
+
tags: string[];
|
|
555
|
+
heroImage: string;
|
|
556
|
+
category: string;
|
|
557
|
+
floatingPoint: string;
|
|
558
|
+
private: boolean;
|
|
559
|
+
shortDescription: string;
|
|
560
|
+
comment: string;
|
|
561
|
+
positiveTriggerWords: string;
|
|
562
|
+
defaultSteps: number;
|
|
563
|
+
defaultGuidanceScale: number;
|
|
564
|
+
defaultStrength: number;
|
|
565
|
+
defaultVaeId: number;
|
|
566
|
+
updatedDateUnixTimestamp: number;
|
|
567
|
+
version: string;
|
|
568
|
+
conditioning: string;
|
|
569
|
+
defaultScheduler: string;
|
|
570
|
+
defaultCFG: number;
|
|
571
|
+
format: string;
|
|
572
|
+
uniqueIdentifier: string;
|
|
573
|
+
architecture: string;
|
|
574
|
+
type: string;
|
|
575
|
+
nsfw: boolean;
|
|
576
|
+
sourceUrl: string;
|
|
577
|
+
downloadCount: number;
|
|
578
|
+
nsfwLevel: number;
|
|
579
|
+
rating: number;
|
|
580
|
+
ratingCount: number;
|
|
581
|
+
thumbsUpCount: number;
|
|
582
|
+
thumbsDownCount: number;
|
|
583
|
+
defaultEmaEnable: boolean;
|
|
584
|
+
defaultImageSizeId: string;
|
|
585
|
+
compatibleSizeIds: number[];
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
### Image Masking
|
|
594
|
+
|
|
595
|
+
[Read Documentation](https://docs.runware.ai/en/image-editing/image-masking)
|
|
596
|
+
|
|
597
|
+
```js
|
|
598
|
+
|
|
599
|
+
const runware = new Runware({ apiKey: "API_KEY" });
|
|
600
|
+
|
|
601
|
+
const imageMasking = await runware.imageMask({
|
|
602
|
+
model: string;
|
|
603
|
+
inputImage: string;
|
|
604
|
+
confidence?: number;
|
|
605
|
+
maskPadding?: number;
|
|
606
|
+
maskBlur?: number;
|
|
607
|
+
outputFormat?: string;
|
|
608
|
+
outputType?: string;
|
|
609
|
+
includeCost?: boolean;
|
|
610
|
+
uploadEndpoint?: string;
|
|
611
|
+
customTaskUUID?: string;
|
|
612
|
+
retry?: number;
|
|
613
|
+
})
|
|
614
|
+
console.log(imageMasking)
|
|
615
|
+
|
|
616
|
+
export type TImageMaskingResponse = {
|
|
617
|
+
taskType: string;
|
|
618
|
+
taskUUID: string;
|
|
619
|
+
imageUUID: string;
|
|
620
|
+
|
|
621
|
+
detections: [
|
|
622
|
+
{
|
|
623
|
+
x_min: number;
|
|
624
|
+
y_min: number;
|
|
625
|
+
x_max: number;
|
|
626
|
+
y_max: number;
|
|
627
|
+
}
|
|
628
|
+
];
|
|
629
|
+
maskImageURL: string;
|
|
630
|
+
cost: number;
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
|
|
516
635
|
```
|
|
517
636
|
|
|
518
637
|
|
|
@@ -525,6 +644,13 @@ export interface IImage {
|
|
|
525
644
|
|
|
526
645
|
## Changelog
|
|
527
646
|
|
|
647
|
+
### - v1.1.21
|
|
648
|
+
|
|
649
|
+
**Added or Changed**
|
|
650
|
+
|
|
651
|
+
- Add Model Search
|
|
652
|
+
- Add Image Masking
|
|
653
|
+
|
|
528
654
|
### - v1.1.20
|
|
529
655
|
|
|
530
656
|
**Added or Changed**
|