diff options
author | sharkiecodes <lanyi_stroud@brown.edu> | 2025-06-10 11:12:23 -0400 |
---|---|---|
committer | sharkiecodes <lanyi_stroud@brown.edu> | 2025-06-10 11:12:23 -0400 |
commit | 272534c8a7517d08c70928c96d487d84b14772f6 (patch) | |
tree | 0e3e9a8cc83b8ba96b2bd49c9fc726b16411d60c /src/server/ApiManagers/FireflyManager.ts | |
parent | c5981504058e0696827b4048fcd908a58fb0b0d3 (diff) | |
parent | b91057d00512446339e48fb8488a97a1e5ef03d5 (diff) |
Merge branch 'master' into lanyi-branch
Diffstat (limited to 'src/server/ApiManagers/FireflyManager.ts')
-rw-r--r-- | src/server/ApiManagers/FireflyManager.ts | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/ApiManagers/FireflyManager.ts b/src/server/ApiManagers/FireflyManager.ts index e934e635b..07ef271a1 100644 --- a/src/server/ApiManagers/FireflyManager.ts +++ b/src/server/ApiManagers/FireflyManager.ts @@ -23,7 +23,7 @@ export default class FireflyManager extends ApiManager { return undefined; }); - generateImageFromStructure = (prompt: string = 'a realistic illustration of a cat coding', width: number = 2048, height: number = 2048, structureUrl: string, strength: number = 50, styles: string[], styleUrl: string | undefined) => + generateImageFromStructure = (prompt: string = 'a realistic illustration of a cat coding', width: number = 2048, height: number = 2048, structureUrl: string, strength: number = 50, styles: string[], styleUrl: string | undefined, variations: number = 4) => this.getBearerToken().then(response => response?.json().then((data: { access_token: string }) => //prettier-ignore @@ -37,7 +37,7 @@ export default class FireflyManager extends ApiManager { ], body: JSON.stringify({ prompt, - numVariations: 4, + numVariations: variations, detailLevel: 'preview', modelVersion: 'image3_fast', size: { width, height }, @@ -107,10 +107,7 @@ export default class FireflyManager extends ApiManager { }); generateImage = (prompt: string = 'a realistic illustration of a cat coding', width: number = 2048, height: number = 2048, seed?: number) => { - let body = `{ "prompt": "${prompt}", "size": { "width": ${width}, "height": ${height}} }`; - if (seed) { - body = `{ "prompt": "${prompt}", "size": { "width": ${width}, "height": ${height}}, "seeds": [${seed}]}`; - } + const body = `{ "prompt": "${prompt}", "size": { "width": ${width}, "height": ${height}} ${seed ? ', "seeds": [' + seed + ']' : ''}}`; const fetched = this.getBearerToken().then(response => response?.json().then((data: { access_token: string }) => fetch('https://firefly-api.adobe.io/v3/images/generate', { |