feat: enhance canvas functionality with new asset node type and improved image handling
- Introduced a new "asset" node type in the canvas sidebar for better resource management. - Updated image node components to support dynamic image dimensions and improved resizing logic. - Enhanced prompt and AI image nodes to utilize reference images from asset nodes, improving integration and functionality. - Refactored canvas utilities to accommodate new asset configurations and maintain consistent media handling.
This commit is contained in:
@@ -162,6 +162,7 @@ export const generateImage = action({
|
||||
nodeId: v.id("nodes"),
|
||||
prompt: v.string(),
|
||||
referenceStorageId: v.optional(v.id("_storage")),
|
||||
referenceImageUrl: v.optional(v.string()),
|
||||
model: v.optional(v.string()),
|
||||
aspectRatio: v.optional(v.string()),
|
||||
},
|
||||
@@ -200,7 +201,7 @@ export const generateImage = action({
|
||||
let retryCount = 0;
|
||||
|
||||
try {
|
||||
let referenceImageUrl: string | undefined;
|
||||
let referenceImageUrl = args.referenceImageUrl?.trim() || undefined;
|
||||
if (args.referenceStorageId) {
|
||||
referenceImageUrl =
|
||||
(await ctx.storage.getUrl(args.referenceStorageId)) ?? undefined;
|
||||
|
||||
Reference in New Issue
Block a user