zavolokas / InpaintingSite

Web app for inpainting
GNU Affero General Public License v3.0
5 stars 4 forks source link

API with settings #17

Closed ferib closed 3 years ago

ferib commented 3 years ago

The API will now accept the following form parameters in the /api/inpaint request:

The usage of this parameter has been hardcoded in inpaint.js#41, the UI has no option to change those parameters (yet). I think this should be good enough? will update UI together with https://github.com/zavolokas/InpaintingSite/issues/4

Edit: also, the gallery has been updated and is now responsive.

ferib commented 3 years ago

Right now it creates an instance of InpaintSettings called defaultSettings which uses the following environment parameters (if present):

If the above parameter is not present, the default value of InpaintSettings for that variable is used. When doing a request, a new instance of InpaintSettings is created and named userSettings. This instance is deserialized from the request body.

The userSettings will be checked against defaultSettings to see if PatchSize and MaxInpaintIterations are not greater then the value specified in userSettings, if so, the value get overwritten with the value from defaultSettings.

ferib commented 3 years ago

FYI the front-end is still using the forum method (not send JSON in body), I have no clue how to do that other than using a bunch of libraries.

zavolokas commented 3 years ago

FYI the front-end is still using the forum method (not send JSON in body), I have no clue how to do that other than using a bunch of libraries.

I think the easiest would be to send a json inside the form data for now(like you did with individual setting, but containing not a single value but the whole json)

P.S.: Ideally it should be multipart request, but it can be done sometime later.

zavolokas commented 3 years ago

@ferib I cannot merge your PR since there are some conflicts image

ferib commented 3 years ago

@zavolokas Can you double-check that? I got 3 green checks.

ferib commented 3 years ago

image