diff options
author | bobzel <zzzman@gmail.com> | 2025-01-13 22:26:35 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-01-13 22:26:35 -0500 |
commit | 12f5a435ee6476e2e07ded0c9cdd597c70ca8af0 (patch) | |
tree | 258d3f999329bf94b5725fb5a04392aa007d6150 /src/client/views/smartdraw/SmartDrawHandler.tsx | |
parent | c2312afe4ee969043ba3ce4cb9c275a48b0f1ee0 (diff) |
changing ai for images and collections to work mostly the same way. fixes for document view/collection/images to keep things working when the ai editor view reduces the rendered document size. fixed so that freeform views overlaid on images/vieos/etc have the ui menu items of collections.
Diffstat (limited to 'src/client/views/smartdraw/SmartDrawHandler.tsx')
-rw-r--r-- | src/client/views/smartdraw/SmartDrawHandler.tsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/smartdraw/SmartDrawHandler.tsx b/src/client/views/smartdraw/SmartDrawHandler.tsx index f635b5642..7db9ef133 100644 --- a/src/client/views/smartdraw/SmartDrawHandler.tsx +++ b/src/client/views/smartdraw/SmartDrawHandler.tsx @@ -271,16 +271,16 @@ export class SmartDrawHandler extends ObservableReactComponent<object> { createImageWithFirefly = (input: string, seed?: number, changeInPlace?: boolean): Promise<FireflyImageData> => { this._lastInput.text = input; const dims = FireflyDimensionsMap[this._imgDims]; - return Networking.PostToServer('/queryFireflyImage', { prompt: input, width: dims.width, height: dims.height, seed: seed }) + return Networking.PostToServer('/queryFireflyImage', { prompt: input, width: dims.width, height: dims.height, seed }) .then(img => { - const seed = img.accessPaths.agnostic.client.match(/\/(\d+)upload/)[1]; + const newseed = img.accessPaths.agnostic.client.match(/\/(\d+)upload/)[1]; if (!changeInPlace) { const imgDoc: Doc = Docs.Create.ImageDocument(img.accessPaths.agnostic.client, { title: input.match(/^(.*?)~~~.*$/)?.[1] || input, nativeWidth: dims.width, nativeHeight: dims.height, ai: 'firefly', - ai_firefly_seed: seed, + ai_firefly_seed: newseed, ai_firefly_prompt: input, }); DocumentViewInternal.addDocTabFunc(imgDoc, OpenWhere.addRight); @@ -306,7 +306,7 @@ export class SmartDrawHandler extends ObservableReactComponent<object> { case DocumentType.IMG: if (this._regenInput) { // if (this._selectedDoc) { - const newPrompt = `${doc.ai_firefly_prompt} ~~~ ${this._regenInput}`; + const newPrompt = doc.ai_firefly_prompt ? `${doc.ai_firefly_prompt} ~~~ ${this._regenInput}` : this._regenInput; return this.createImageWithFirefly(newPrompt, NumCast(doc?.ai_firefly_seed), changeInPlace); // } } |