aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-05-22 12:32:39 -0400
committerbobzel <zzzman@gmail.com>2025-05-22 12:32:39 -0400
commitec30cdb94b9418a952643d016fa7e78955f5f9ab (patch)
tree613eb87fad8b3d40e34d866571885407bffe8ad5 /src
parenteae106461db8bbdf95a8ab3d2a76ba2030ed2148 (diff)
fixed regenerating a fireflyimage without a prompt change.
Diffstat (limited to 'src')
-rw-r--r--src/client/views/FieldsDropdown.tsx1
-rw-r--r--src/client/views/smartdraw/SmartDrawHandler.tsx5
-rw-r--r--src/server/ApiManagers/FireflyManager.ts5
3 files changed, 4 insertions, 7 deletions
diff --git a/src/client/views/FieldsDropdown.tsx b/src/client/views/FieldsDropdown.tsx
index 74ff8ffd4..0bdf92bbc 100644
--- a/src/client/views/FieldsDropdown.tsx
+++ b/src/client/views/FieldsDropdown.tsx
@@ -62,7 +62,6 @@ export class FieldsDropdown extends ObservableReactComponent<fieldsDropdownProps
.forEach((pair: [string, unknown]) => filteredOptions.push(pair[0]));
const options = filteredOptions.sort().map(facet => ({ value: facet, label: facet }));
- console.log(this._props.isInactive);
return (
<Select
styles={{
diff --git a/src/client/views/smartdraw/SmartDrawHandler.tsx b/src/client/views/smartdraw/SmartDrawHandler.tsx
index 3976ec39e..b7ff5fff7 100644
--- a/src/client/views/smartdraw/SmartDrawHandler.tsx
+++ b/src/client/views/smartdraw/SmartDrawHandler.tsx
@@ -330,8 +330,9 @@ export class SmartDrawHandler extends ObservableReactComponent<object> {
switch (doc.type) {
case DocumentType.IMG: {
const func = changeInPlace ? this.recreateImageWithFirefly : this.createImageWithFirefly;
- const newPrompt = doc.ai_prompt && doc.ai_prompt !== this._regenInput ? `${doc.ai_prompt} ~~~ ${this._regenInput}` : this._regenInput;
- return this._regenInput ? func(newPrompt, NumCast(doc?.ai_prompt_seed)) : func(this._lastInput.text || StrCast(doc.ai_prompt));
+ const promptChange = doc.ai_prompt && doc.ai_prompt !== this._regenInput;
+ const newPrompt = promptChange ? `${doc.ai_prompt} ~~~ ${this._regenInput}` : this._regenInput;
+ return this._regenInput ? func(newPrompt, promptChange ? NumCast(doc?.ai_prompt_seed) : undefined) : func(this._lastInput.text || StrCast(doc.ai_prompt));
}
case DocumentType.COL: {
try {
diff --git a/src/server/ApiManagers/FireflyManager.ts b/src/server/ApiManagers/FireflyManager.ts
index e934e635b..effc81d9b 100644
--- a/src/server/ApiManagers/FireflyManager.ts
+++ b/src/server/ApiManagers/FireflyManager.ts
@@ -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', {