fix(tools): lama cleaner masking with custom mask upload & independent change photo for two-images tools

This commit is contained in:
2026-11-12 15:37:18 +05:30
parent 1bb3daec8d
commit 9b25523349
5 changed files with 412 additions and 146 deletions
+244 -82
View File
@@ -14,7 +14,10 @@ import {
RefreshCw,
FolderOpen,
Zap,
Crop
Crop,
Camera,
CheckCircle2,
Trash2
} from 'lucide-react';
import {
ToolItem,
@@ -165,9 +168,11 @@ export function DynamicToolWorkspace({
setResultUrl(null);
setErrorMessage('');
setStatus('idle');
setViewMode('studio'); // Transition straight into the editing workspace!
if (typeof window !== 'undefined') {
window.scrollTo({ top: 0, behavior: 'smooth' });
if (pageType !== 'two-images') {
setViewMode('studio'); // Transition straight into the editing workspace!
if (typeof window !== 'undefined') {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}
};
@@ -177,8 +182,14 @@ export function DynamicToolWorkspace({
setErrorMessage('Please upload a valid JPG, PNG, or WebP photo.');
return;
}
const maxBytes = (tool.tryIt?.limits?.maxMB || 12) * 1024 * 1024;
if (file.size > maxBytes) {
setErrorMessage(`File exceeds max size of ${tool.tryIt?.limits?.maxMB || 12}MB.`);
return;
}
setSecondaryFile(file);
setSecondaryPreview(URL.createObjectURL(file));
setErrorMessage('');
};
const handleLoadSample = (sampleUrl: string) => {
@@ -272,14 +283,18 @@ export function DynamicToolWorkspace({
// 3. Mask Image (for masking archetype)
if (pageType === 'masking') {
const maskParamName = tool.maskingConfig?.maskParamName || 'mask';
let maskBlob: Blob | null = null;
if (getMaskBlobRef.current) {
const maskBlob = await getMaskBlobRef.current();
if (maskBlob) {
formData.append(maskParamName, maskBlob, 'mask.png');
if (maskParamName !== 'mask') {
formData.append('mask', maskBlob, 'mask.png');
}
}
maskBlob = await getMaskBlobRef.current();
}
if (!maskBlob || !hasMaskDrawn) {
setStatus('error');
setErrorMessage('Please paint over the object or upload a custom mask to erase.');
return;
}
formData.append(maskParamName, maskBlob, 'mask.png');
if (maskParamName !== 'mask') {
formData.append('mask', maskBlob, 'mask.png');
}
}
@@ -526,12 +541,24 @@ export function DynamicToolWorkspace({
{pageType === 'masking' && primaryPreview && (
<div className="space-y-4">
<div className="flex items-center justify-between pb-2 border-b border-rule">
<span className="text-xs font-semibold text-ink font-body">
Inpainting & Object Masking Studio
</span>
<span className="text-[11px] text-muted font-body">
Paint over areas to remove or replace
</span>
<div className="flex items-center gap-2">
<span className="text-xs font-semibold text-ink font-body">
Inpainting & Object Masking Studio
</span>
<span className="text-[11px] text-muted font-body hidden sm:inline">
— Paint over areas with brush or upload custom mask
</span>
</div>
<div className="flex items-center gap-2">
<button
type="button"
onClick={() => fileInputRef.current?.click()}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-body font-semibold text-accent bg-accent/10 hover:bg-accent/20 transition-colors cursor-pointer"
>
<RefreshCw className="w-3.5 h-3.5" />
<span>Change Photo</span>
</button>
</div>
</div>
<MaskCanvasEditor
@@ -624,15 +651,49 @@ export function DynamicToolWorkspace({
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
{/* Primary Image Slot */}
<div className="space-y-2">
<span className="text-xs font-semibold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.firstImageLabel, locale) || 'Primary Photo'}
</span>
<div className="aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 border border-rule relative">
<div className="flex items-center justify-between">
<span className="text-xs font-semibold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.firstImageLabel, locale) || '1. Primary Photo'}
</span>
{primaryPreview && (
<button
type="button"
onClick={() => fileInputRef.current?.click()}
className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-xl text-[11px] font-sans font-semibold text-accent bg-accent/10 hover:bg-accent/20 transition-colors cursor-pointer"
>
<RefreshCw className="w-3 h-3" />
<span>Change Photo</span>
</button>
)}
</div>
<input
ref={fileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handlePrimaryFileSelect(e.target.files[0]);
}}
/>
<div className="aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 border border-rule relative group">
{primaryPreview ? (
// eslint-disable-next-line @next/next/no-img-element
<img src={primaryPreview} alt="Primary" className="w-full h-full object-contain" />
<>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={primaryPreview} alt="Primary" className="w-full h-full object-contain" />
<button
type="button"
onClick={() => fileInputRef.current?.click()}
className="absolute top-3 right-3 px-3 py-1.5 rounded-full bg-slate-900/80 hover:bg-slate-900 text-white text-xs font-medium backdrop-blur-md shadow-md flex items-center gap-1.5 transition-all opacity-90 hover:opacity-100 cursor-pointer"
>
<Camera className="w-3.5 h-3.5" />
<span>Change Photo 1</span>
</button>
</>
) : (
<div className="w-full h-full flex flex-col items-center justify-center p-4 text-muted text-xs">
<div
onClick={() => fileInputRef.current?.click()}
className="w-full h-full flex flex-col items-center justify-center p-4 text-muted text-xs cursor-pointer hover:bg-paper transition-colors"
>
<UploadCloud className="w-6 h-6 mb-2 text-accent" />
<span>Upload primary photo</span>
</div>
@@ -642,27 +703,52 @@ export function DynamicToolWorkspace({
{/* Secondary Image Slot */}
<div className="space-y-2">
<span className="text-xs font-semibold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.secondImageLabel, locale) || 'Reference / Style Photo'}
</span>
<div className="aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 border border-rule relative">
<div className="flex items-center justify-between">
<span className="text-xs font-semibold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.secondImageLabel, locale) || '2. Reference / Style Photo'}
</span>
{secondaryPreview && (
<button
type="button"
onClick={() => secondaryFileInputRef.current?.click()}
className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-xl text-[11px] font-sans font-semibold text-accent bg-accent/10 hover:bg-accent/20 transition-colors cursor-pointer"
>
<RefreshCw className="w-3 h-3" />
<span>Change Photo</span>
</button>
)}
</div>
<input
ref={secondaryFileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handleSecondaryFileSelect(e.target.files[0]);
}}
/>
<div className="aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 border border-rule relative group">
{secondaryPreview ? (
// eslint-disable-next-line @next/next/no-img-element
<img src={secondaryPreview} alt="Secondary" className="w-full h-full object-contain" />
<>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={secondaryPreview} alt="Secondary" className="w-full h-full object-contain" />
<button
type="button"
onClick={() => secondaryFileInputRef.current?.click()}
className="absolute top-3 right-3 px-3 py-1.5 rounded-full bg-slate-900/80 hover:bg-slate-900 text-white text-xs font-medium backdrop-blur-md shadow-md flex items-center gap-1.5 transition-all opacity-90 hover:opacity-100 cursor-pointer"
>
<Camera className="w-3.5 h-3.5" />
<span>Change Photo 2</span>
</button>
</>
) : (
<label className="w-full h-full flex flex-col items-center justify-center p-4 text-muted text-xs cursor-pointer hover:bg-paper transition-colors">
<div
onClick={() => secondaryFileInputRef.current?.click()}
className="w-full h-full flex flex-col items-center justify-center p-4 text-muted text-xs cursor-pointer hover:bg-paper transition-colors"
>
<UploadCloud className="w-6 h-6 mb-2 text-accent" />
<span>Click to upload reference photo</span>
<input
ref={secondaryFileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handleSecondaryFileSelect(e.target.files[0]);
}}
/>
</label>
</div>
)}
</div>
</div>
@@ -909,47 +995,117 @@ export function DynamicToolWorkspace({
{pageType === 'two-images' && (
<div className="space-y-5">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
{/* Image 1 Dropzone */}
<div
onClick={() => fileInputRef.current?.click()}
className="p-5 rounded-2xl border-2 border-dashed border-rule hover:border-accent bg-paper hover:bg-accent/5 transition-all cursor-pointer flex flex-col items-center justify-center text-center space-y-2 min-h-[160px]"
>
<input
ref={fileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handlePrimaryFileSelect(e.target.files[0]);
}}
/>
<UploadCloud className="w-6 h-6 text-accent" />
<span className="text-xs font-bold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.firstImageLabel, locale) || '1. Source Face'}
</span>
<span className="text-[10px] text-muted font-body">Click to choose</span>
</div>
{/* Image 1 Slot */}
<input
ref={fileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handlePrimaryFileSelect(e.target.files[0]);
}}
/>
{primaryPreview ? (
<div className="p-4 rounded-2xl border border-rule bg-paper-hi shadow-xs flex flex-col justify-between space-y-3 min-h-[180px]">
<div className="flex items-center justify-between">
<span className="text-xs font-bold text-ink font-body flex items-center gap-1.5">
<CheckCircle2 className="w-4 h-4 text-emerald-500" />
<span>{resolveLocalised(tool.twoImagesConfig?.firstImageLabel, locale) || '1. Primary Photo'}</span>
</span>
<button
type="button"
onClick={(e) => {
e.stopPropagation();
setPrimaryFile(null);
setPrimaryPreview(null);
}}
className="text-slate-400 hover:text-red-500 p-1 transition-colors cursor-pointer"
title="Remove photo"
>
<Trash2 className="w-3.5 h-3.5" />
</button>
</div>
<div className="w-full h-28 rounded-xl overflow-hidden bg-paper-2 flex items-center justify-center">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={primaryPreview} alt="Primary preview" className="w-full h-full object-contain" />
</div>
<button
type="button"
onClick={() => fileInputRef.current?.click()}
className="w-full py-2 px-3 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-800 text-xs font-semibold flex items-center justify-center gap-1.5 transition-colors cursor-pointer"
>
<RefreshCw className="w-3.5 h-3.5" />
<span>Change Photo 1</span>
</button>
</div>
) : (
<div
onClick={() => fileInputRef.current?.click()}
className="p-5 rounded-2xl border-2 border-dashed border-rule hover:border-accent bg-paper hover:bg-accent/5 transition-all cursor-pointer flex flex-col items-center justify-center text-center space-y-2 min-h-[180px]"
>
<UploadCloud className="w-7 h-7 text-accent" />
<span className="text-xs font-bold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.firstImageLabel, locale) || '1. Primary Photo'}
</span>
<span className="text-[10px] text-muted font-body">Click to choose image</span>
</div>
)}
{/* Image 2 Dropzone */}
<div
onClick={() => secondaryFileInputRef.current?.click()}
className="p-5 rounded-2xl border-2 border-dashed border-rule hover:border-accent bg-paper hover:bg-accent/5 transition-all cursor-pointer flex flex-col items-center justify-center text-center space-y-2 min-h-[160px]"
>
<input
ref={secondaryFileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handleSecondaryFileSelect(e.target.files[0]);
}}
/>
<UploadCloud className="w-6 h-6 text-accent" />
<span className="text-xs font-bold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.secondImageLabel, locale) || '2. Target Body/Photo'}
</span>
<span className="text-[10px] text-muted font-body">Click to choose</span>
</div>
{/* Image 2 Slot */}
<input
ref={secondaryFileInputRef}
type="file"
accept="image/*"
className="hidden"
onChange={(e) => {
if (e.target.files?.[0]) handleSecondaryFileSelect(e.target.files[0]);
}}
/>
{secondaryPreview ? (
<div className="p-4 rounded-2xl border border-rule bg-paper-hi shadow-xs flex flex-col justify-between space-y-3 min-h-[180px]">
<div className="flex items-center justify-between">
<span className="text-xs font-bold text-ink font-body flex items-center gap-1.5">
<CheckCircle2 className="w-4 h-4 text-emerald-500" />
<span>{resolveLocalised(tool.twoImagesConfig?.secondImageLabel, locale) || '2. Reference Photo'}</span>
</span>
<button
type="button"
onClick={(e) => {
e.stopPropagation();
setSecondaryFile(null);
setSecondaryPreview(null);
}}
className="text-slate-400 hover:text-red-500 p-1 transition-colors cursor-pointer"
title="Remove photo"
>
<Trash2 className="w-3.5 h-3.5" />
</button>
</div>
<div className="w-full h-28 rounded-xl overflow-hidden bg-paper-2 flex items-center justify-center">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={secondaryPreview} alt="Secondary preview" className="w-full h-full object-contain" />
</div>
<button
type="button"
onClick={() => secondaryFileInputRef.current?.click()}
className="w-full py-2 px-3 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-800 text-xs font-semibold flex items-center justify-center gap-1.5 transition-colors cursor-pointer"
>
<RefreshCw className="w-3.5 h-3.5" />
<span>Change Photo 2</span>
</button>
</div>
) : (
<div
onClick={() => secondaryFileInputRef.current?.click()}
className="p-5 rounded-2xl border-2 border-dashed border-rule hover:border-accent bg-paper hover:bg-accent/5 transition-all cursor-pointer flex flex-col items-center justify-center text-center space-y-2 min-h-[180px]"
>
<UploadCloud className="w-7 h-7 text-accent" />
<span className="text-xs font-bold text-ink font-body">
{resolveLocalised(tool.twoImagesConfig?.secondImageLabel, locale) || '2. Reference Photo'}
</span>
<span className="text-[10px] text-muted font-body">Click to choose image</span>
</div>
)}
</div>
<button
@@ -963,7 +1119,13 @@ export function DynamicToolWorkspace({
className="w-full py-4 rounded-2xl bg-accent hover:bg-accent-hi text-white font-display font-bold text-sm shadow-md hover:shadow-lg transition-all cursor-pointer flex items-center justify-center gap-2.5"
>
<Sparkles className="w-4 h-4 text-amber-300" />
<span>Open Fusion Studio</span>
<span>
{primaryPreview && secondaryPreview
? 'Open Fusion Studio (Both Photos Ready)'
: primaryPreview || secondaryPreview
? 'Continue to Studio'
: 'Open Fusion Studio'}
</span>
</button>
</div>
)}
+152 -47
View File
@@ -11,7 +11,8 @@ import {
Eye,
EyeOff,
RotateCcw,
Maximize2
Maximize2,
UploadCloud
} from 'lucide-react';
import { MaskingConfig, resolveLocalised } from '@/types';
import { ProcessingOverlay } from './ProcessingOverlay';
@@ -38,6 +39,7 @@ export function MaskCanvasEditor({
const containerRef = useRef<HTMLDivElement>(null);
const imageRef = useRef<HTMLImageElement>(null);
const maskCanvasRef = useRef<HTMLCanvasElement>(null);
const maskFileInputRef = useRef<HTMLInputElement>(null);
const [tool, setTool] = useState<'brush' | 'eraser'>('brush');
const [brushSize, setBrushSize] = useState<number>(config?.defaultBrushSize || 32);
@@ -169,6 +171,85 @@ export function MaskCanvasEditor({
saveHistory();
};
// Upload and parse custom mask file (supports B&W or transparent PNG)
const handleCustomMaskUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
const reader = new FileReader();
reader.onload = () => {
const img = new Image();
img.onload = () => {
const canvas = maskCanvasRef.current;
if (!canvas) return;
const ctx = canvas.getContext('2d', { willReadFrequently: true });
if (!ctx) return;
// Sample and scale uploaded mask to match base canvas dimensions
const tempCanvas = document.createElement('canvas');
tempCanvas.width = canvas.width;
tempCanvas.height = canvas.height;
const tempCtx = tempCanvas.getContext('2d', { willReadFrequently: true });
if (!tempCtx) return;
tempCtx.drawImage(img, 0, 0, canvas.width, canvas.height);
const uploadedData = tempCtx.getImageData(0, 0, canvas.width, canvas.height);
const uD = uploadedData.data;
// Check if uploaded mask has alpha transparency
let hasAlphaVariation = false;
for (let i = 0; i < uD.length; i += 16) {
if (uD[i + 3] < 240) {
hasAlphaVariation = true;
break;
}
}
// Apply interactive red overlay on canvas
ctx.clearRect(0, 0, canvas.width, canvas.height);
const maskOverlay = ctx.createImageData(canvas.width, canvas.height);
const mD = maskOverlay.data;
for (let i = 0; i < uD.length; i += 4) {
const r = uD[i];
const g = uD[i + 1];
const b = uD[i + 2];
const a = uD[i + 3];
let isMasked = false;
if (hasAlphaVariation) {
// Non-transparent pixels count as mask
isMasked = a > 40;
} else {
// Solid B&W mask: bright/white pixels (> 50 brightness) count as mask
const brightness = 0.299 * r + 0.587 * g + 0.114 * b;
isMasked = brightness > 50;
}
if (isMasked) {
mD[i] = 239; // R
mD[i + 1] = 68; // G
mD[i + 2] = 68; // B
mD[i + 3] = 160; // Alpha
} else {
mD[i + 3] = 0;
}
}
ctx.putImageData(maskOverlay, 0, 0);
saveHistory();
setHasDrawnMask(true);
onMaskChange?.(true);
// Reset input value so re-selecting same file triggers onChange
e.target.value = '';
};
img.src = reader.result as string;
};
reader.readAsDataURL(file);
};
// Convert canvas pointer coordinate to natural canvas pixels
const getCanvasCoords = (e: React.PointerEvent<HTMLCanvasElement>) => {
const canvas = maskCanvasRef.current;
@@ -213,7 +294,9 @@ export function MaskCanvasEditor({
const handlePointerDown = (e: React.PointerEvent<HTMLCanvasElement>) => {
if (e.button !== 0 && e.pointerType === 'mouse') return;
e.currentTarget.setPointerCapture(e.pointerId);
try {
e.currentTarget.setPointerCapture(e.pointerId);
} catch {}
setIsDrawing(true);
const { x, y } = getCanvasCoords(e);
@@ -396,6 +479,24 @@ export function MaskCanvasEditor({
<span>Eraser (Sub)</span>
</button>
{/* Upload Custom Mask Button */}
<input
ref={maskFileInputRef}
type="file"
accept="image/png,image/jpeg,image/webp"
className="hidden"
onChange={handleCustomMaskUpload}
/>
<button
type="button"
onClick={() => maskFileInputRef.current?.click()}
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-body font-semibold text-accent bg-accent/10 border border-accent/20 hover:bg-accent/20 transition-colors cursor-pointer"
title="Upload an external black-and-white or transparent PNG mask"
>
<UploadCloud className="w-3.5 h-3.5" />
<span>Upload Custom Mask</span>
</button>
{/* Auto-Mask Detection Button (if configured) */}
{config?.autoMask?.enabled !== false && (
<button
@@ -481,60 +582,64 @@ export function MaskCanvasEditor({
{/* Interactive Mask Canvas Stage */}
<div
ref={containerRef}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => {
setIsHovered(false);
setCursorPos(null);
}}
className="relative w-full max-h-[600px] overflow-hidden rounded-2xl bg-paper-2 border border-rule flex items-center justify-center cursor-crosshair select-none isolate"
className="relative w-full max-h-[600px] overflow-hidden rounded-2xl bg-paper-2 border border-rule flex items-center justify-center select-none isolate p-2 sm:p-4"
>
{/* Underlying Image */}
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
ref={imageRef}
src={imageUrl}
alt="Original for masking"
onLoad={setupCanvas}
className="max-h-[580px] w-auto max-w-full object-contain pointer-events-none"
/>
{/* Mask Overlay Canvas */}
<canvas
ref={maskCanvasRef}
onPointerDown={handlePointerDown}
onPointerMove={handlePointerMove}
onPointerUp={handlePointerUp}
onPointerCancel={handlePointerUp}
style={{
touchAction: 'none',
opacity: showMask ? 1 : 0
<div
className="relative inline-flex items-center justify-center max-h-[580px] max-w-full cursor-crosshair overflow-hidden rounded-xl shadow-xs"
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => {
setIsHovered(false);
setCursorPos(null);
}}
className="absolute inset-0 w-full h-full object-contain pointer-events-auto transition-opacity"
/>
{/* Live Circular Brush Size Cursor Indicator */}
{isHovered && cursorPos && (
<div
className="pointer-events-none absolute rounded-full border-2 border-white/90 shadow-[0_0_8px_rgba(0,0,0,0.5)] -translate-x-1/2 -translate-y-1/2 z-30"
style={{
left: `${cursorPos.x}px`,
top: `${cursorPos.y}px`,
width: `${brushSize}px`,
height: `${brushSize}px`,
backgroundColor: tool === 'brush' ? 'rgba(239, 68, 68, 0.35)' : 'rgba(255, 255, 255, 0.35)',
}}
>
{/* Underlying Image */}
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
ref={imageRef}
src={imageUrl}
alt="Original for masking"
onLoad={setupCanvas}
className="max-h-[580px] w-auto max-w-full block pointer-events-none select-none"
/>
)}
{/* Mask Overlay Canvas */}
<canvas
ref={maskCanvasRef}
onPointerDown={handlePointerDown}
onPointerMove={handlePointerMove}
onPointerUp={handlePointerUp}
onPointerCancel={handlePointerUp}
style={{
touchAction: 'none',
opacity: showMask ? 1 : 0
}}
className="absolute inset-0 w-full h-full pointer-events-auto transition-opacity"
/>
{/* Live Circular Brush Size Cursor Indicator */}
{isHovered && cursorPos && (
<div
className="pointer-events-none absolute rounded-full border-2 border-white/90 shadow-[0_0_8px_rgba(0,0,0,0.5)] -translate-x-1/2 -translate-y-1/2 z-30"
style={{
left: `${cursorPos.x}px`,
top: `${cursorPos.y}px`,
width: `${brushSize}px`,
height: `${brushSize}px`,
backgroundColor: tool === 'brush' ? 'rgba(239, 68, 68, 0.35)' : 'rgba(255, 255, 255, 0.35)',
}}
/>
)}
</div>
{/* Laser Scanning Processing Animation Overlay */}
{isProcessing && <ProcessingOverlay toolName={toolName || 'Inpainting Model'} />}
</div>
{/* Canvas Helper Hint */}
<div className="flex items-center justify-between text-xs text-muted font-body px-1">
<span>💡 Paint over objects, tourists, or areas you wish to modify or erase.</span>
<span className="font-mono text-[11px]">
{hasDrawnMask ? 'Mask ready for processing' : 'No mask drawn yet'}
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-1 text-xs text-muted font-body px-1">
<span>💡 Paint over objects with the brush, or upload an external custom mask image (B&W or PNG).</span>
<span className="font-mono text-[11px] font-semibold text-ink">
{hasDrawnMask ? '✓ Mask ready for inpainting' : 'No mask drawn yet'}
</span>
</div>
</div>
+1
View File
@@ -195,6 +195,7 @@ export interface MaskingConfig {
maskParamName?: string;
imageParamName?: string;
defaultBrushSize?: number;
allowCustomMaskUpload?: boolean;
}
export interface TwoImagesConfig {