@@ -52,6 +52,8 @@ const InPaintEditor = observer(
5252 const { curSession } = appState ;
5353 const resolutionOptions = Object . entries ( resolutionMap )
5454 . map ( ( [ key , value ] ) => {
55+ const resolVal = ( editingScene . resolutionWidth ?? '' ) + 'x' + ( editingScene . resolutionHeight ?? '' ) ;
56+ if ( key === 'custom' ) return { label : '커스텀 (' + resolVal + ')' , value : key } ;
5557 return { label : `${ value . width } x${ value . height } ` , value : key } ;
5658 } )
5759 . filter ( ( x ) => ! x . value . startsWith ( 'small' ) ) ;
@@ -138,7 +140,7 @@ const InPaintEditor = observer(
138140 } ) ;
139141 } ;
140142
141- const confirm = async ( ) => {
143+ const saveMask = async ( ) => {
142144 if ( def . hasMask ) {
143145 const mask = await brushTool . current ! . getMaskBase64 ( ) ;
144146 if ( ! editingScene . preset . mask ) {
@@ -154,6 +156,10 @@ const InPaintEditor = observer(
154156 ) ;
155157 }
156158 }
159+ } ;
160+
161+ const confirm = async ( ) => {
162+ await saveMask ( ) ;
157163 onConfirm ( ) ;
158164 } ;
159165
@@ -191,7 +197,7 @@ const InPaintEditor = observer(
191197 options = { resolutionOptions }
192198 menuPlacement = "bottom"
193199 selectedOption = { editingScene . resolution }
194- onSelect = { ( opt ) => {
200+ onSelect = { async ( opt ) => {
195201 if (
196202 opt . value . startsWith ( 'large' ) ||
197203 opt . value . startsWith ( 'wallpaper' )
@@ -203,6 +209,25 @@ const InPaintEditor = observer(
203209 editingScene . resolution = opt . value as Resolution ;
204210 } ,
205211 } ) ;
212+ } else if ( opt . value === 'custom' ) {
213+ const width = await appState . pushDialogAsync ( {
214+ type : 'input-confirm' ,
215+ text : '해상도 너비를 입력해주세요'
216+ } ) ;
217+ if ( width == null ) return ;
218+ const height = await appState . pushDialogAsync ( {
219+ type : 'input-confirm' ,
220+ text : '해상도 높이를 입력해주세요'
221+ } ) ;
222+ if ( height == null ) return ;
223+ try {
224+ const customResolution = { width : parseInt ( width ) , height : parseInt ( height ) } ;
225+ editingScene . resolution = opt . value as Resolution ;
226+ editingScene . resolutionWidth = ( customResolution . width + 63 ) & ~ 63 ;
227+ editingScene . resolutionHeight = ( customResolution . height + 63 ) & ~ 63 ;
228+ } catch ( e : any ) {
229+ appState . pushMessage ( e . message ) ;
230+ }
206231 } else {
207232 editingScene . resolution = opt . value as Resolution ;
208233 }
@@ -317,6 +342,7 @@ const InPaintEditor = observer(
317342 < button
318343 className = { `round-button back-green h-8 w-16 md:w-36 flex items-center justify-center` }
319344 onClick = { async ( ) => {
345+ await saveMask ( ) ;
320346 await queueI2IWorkflow ( curSession ! , editingScene . workflowType , editingScene . preset , editingScene , 1 , ( path : string ) => {
321347 ( async ( ) => {
322348 const data = await imageService . fetchImage ( path ) ;
0 commit comments