kritiksoman / GIMP-ML

AI for GNU Image Manipulation Program
https://kritiksoman.github.io/GIMP-ML-Docs/index.html
MIT License
1.39k stars 126 forks source link

More intuitive inpainting #36

Open UserUnknownFactor opened 3 years ago

UserUnknownFactor commented 3 years ago

Is your feature request related to a problem? Please describe. Currently inpainting is very difficult to use as is so please make it more availible.

Describe the solution you'd like User actions:

The following actions are done by the plugin:

Additional context Currently if inpainting fails it does so silently without any intelligible error messages whatsoever, please fix it too.

kritiksoman commented 3 years ago

We’ll update the inpainting model in gimp 3 ml branch

kritiksoman commented 3 years ago

Please how line 126 to 160 in

inpainting.py for UI change. Or directly ping on slack https://join.slack.com/t/gimp-mlworkspace/shared_invite/zt-rbaxvztx-GRvj941idw3sQ0trS686YA

UserUnknownFactor commented 3 years ago

Mm.. it's not exactly what I asked. Error checking is also part of it but... Can you at least help me with GIMP3 code for what I asked as the main points? Aka selection, layer generation and filling before sending to the inference module?

kritiksoman commented 3 years ago

In GIMP, see Help->Procedure Browser for list of functions available and it's usage.

UserUnknownFactor commented 2 years ago

It's not that I didn't know about help... I tried it like below and got a lot of type errors and I can't figure out what each type should be by myself:

    pdb = Gimp.get_pdb()

    interlace, compression = 0, 2

    drawable = pdb.run_procedure('gimp-image-get-active-drawable', [image])
    arr_drawable = Gimp.ObjectArray.new(Gimp.Drawable, [drawable.index(1)], 1)
    cut_result = pdb.run_procedure('gimp-edit-cut', [1, arr_drawable])
    mask_image = pdb.run_procedure('gimp-edit-paste-as-new-image', [])
    mask_layer_group = pdb.run_procedure('gimp-layer-group-new', [mask_image.index(1)])

    pdb.run_procedure('file-png-save', [
        GObject.Value(Gimp.RunMode, Gimp.RunMode.NONINTERACTIVE),
        GObject.Value(Gimp.Image, mask_layer_group),
        GObject.Value(GObject.TYPE_INT, 1),
        GObject.Value(Gimp.ObjectArray, arr_drawable),
# ...
    pdb.run_procedure('file-png-save', [
        GObject.Value(Gimp.RunMode, Gimp.RunMode.NONINTERACTIVE),
        GObject.Value(Gimp.Image, image),
        GObject.Value(GObject.TYPE_INT, 1),
        GObject.Value(Gimp.ObjectArray, arr_drawable),
kritiksoman commented 2 years ago

sorry but there is not much documentation available, the best way is to see other plugin files and see usage.

kritiksoman commented 2 years ago

this is the only documentation available for the time being https://github.com/GNOME/gimp/tree/master/devel-docs/GIMP3-plug-in-porting-guide