This commit is contained in:
luboslenco
2024-02-26 21:20:59 +01:00
parent ed9820252b
commit d9dbdb6d28
42 changed files with 143 additions and 129 deletions
Binary file not shown.
+4 -4
View File
@@ -41,14 +41,14 @@ class UINodesExt {
if (texbase != null) {
let texpaint = render_path_render_targets.get("texpaint").image;
g2_begin(texpaint, false);
g2_begin(texpaint);
g2_draw_scaled_image(texbase, 0, 0, Config.getTextureResX(), Config.getTextureResY());
g2_end();
}
if (texnor != null) {
let texpaint_nor = render_path_render_targets.get("texpaint_nor").image;
g2_begin(texpaint_nor, false);
g2_begin(texpaint_nor);
g2_draw_scaled_image(texnor, 0, 0, Config.getTextureResX(), Config.getTextureResY());
g2_end();
}
@@ -60,7 +60,7 @@ class UINodesExt {
let texpaint_pack = render_path_render_targets.get("texpaint_pack").image;
if (texocc != null) {
g2_begin(texpaint_pack, false);
g2_begin(texpaint_pack);
g2_set_pipeline(Base.pipeCopyR);
g2_draw_scaled_image(texocc, 0, 0, Config.getTextureResX(), Config.getTextureResY());
g2_set_pipeline(null);
@@ -68,7 +68,7 @@ class UINodesExt {
}
if (texrough != null) {
g2_begin(texpaint_pack, false);
g2_begin(texpaint_pack);
g2_set_pipeline(Base.pipeCopyG);
g2_draw_scaled_image(texrough, 0, 0, Config.getTextureResX(), Config.getTextureResY());
g2_set_pipeline(null);
+3 -3
View File
@@ -55,7 +55,7 @@ class InpaintNode extends LogicNode {
Console.progress(tr("Processing") + " - " + tr("Inpaint"));
Base.notifyOnNextFrame(() => {
g2_begin(InpaintNode.image, false);
g2_begin(InpaintNode.image);
g2_draw_scaled_image(source, 0, 0, Config.getTextureResX(), Config.getTextureResY());
g2_end();
@@ -127,7 +127,7 @@ class InpaintNode extends LogicNode {
}
}
g2_begin(InpaintNode.temp, false);
g2_begin(InpaintNode.temp);
// g2_drawImage(image, -x * 512, -y * 512);
g2_draw_scaled_image(image, 0, 0, 512, 512);
g2_end();
@@ -164,7 +164,7 @@ class InpaintNode extends LogicNode {
let start = num_inference_steps - init_timestep;
TextToPhotoNode.stableDiffusion(InpaintNode.prompt, (img: image_t) => {
// result.g2_begin(false);
// result.g2_begin();
// result.g2_draw_image(img, x * 512, y * 512);
// result.g2_end();
InpaintNode.result = img;
+2 -2
View File
@@ -48,7 +48,7 @@ class PhotoToPBRNode extends LogicNode {
let x = i % tilesX;
let y = Math.floor(i / tilesX);
g2_begin(PhotoToPBRNode.temp, false);
g2_begin(PhotoToPBRNode.temp);
g2_draw_scaled_image(source, PhotoToPBRNode.borderW - x * PhotoToPBRNode.tileW, PhotoToPBRNode.borderW - y * PhotoToPBRNode.tileW, -Config.getTextureResX(), Config.getTextureResY());
g2_draw_scaled_image(source, PhotoToPBRNode.borderW - x * PhotoToPBRNode.tileW, PhotoToPBRNode.borderW - y * PhotoToPBRNode.tileW, Config.getTextureResX(), -Config.getTextureResY());
g2_draw_scaled_image(source, PhotoToPBRNode.borderW - x * PhotoToPBRNode.tileW, PhotoToPBRNode.borderW - y * PhotoToPBRNode.tileW, -Config.getTextureResX(), -Config.getTextureResY());
@@ -142,7 +142,7 @@ class PhotoToPBRNode extends LogicNode {
///end
let temp2 = image_from_bytes(u8a.buffer, PhotoToPBRNode.tileW, PhotoToPBRNode.tileW);
g2_begin(PhotoToPBRNode.images[from], false);
g2_begin(PhotoToPBRNode.images[from]);
g2_draw_image(temp2, x * PhotoToPBRNode.tileW, y * PhotoToPBRNode.tileW);
g2_end();
Base.notifyOnNextFrame(() => {
+2 -2
View File
@@ -30,7 +30,7 @@ class TilingNode extends LogicNode {
override getAsImage = (from: i32, done: (img: image_t)=>void) => {
this.inputs[0].getAsImage((source: image_t) => {
g2_begin(TilingNode.image, false);
g2_begin(TilingNode.image);
g2_draw_scaled_image(source, 0, 0, Config.getTextureResX(), Config.getTextureResY());
g2_end();
@@ -52,7 +52,7 @@ class TilingNode extends LogicNode {
static sdTiling = (image: image_t, seed: i32/* = -1*/, done: (img: image_t)=>void) => {
TextToPhotoNode.tiling = false;
let tile = image_create_render_target(512, 512);
g2_begin(tile, false);
g2_begin(tile);
g2_draw_scaled_image(image, -256, -256, 512, 512);
g2_draw_scaled_image(image, 256, -256, 512, 512);
g2_draw_scaled_image(image, -256, 256, 512, 512);
+3 -3
View File
@@ -50,7 +50,7 @@ class UpscaleNode extends LogicNode {
image_unload(UpscaleNode.temp);
}
UpscaleNode.temp = image_create_render_target(size1w, size1h);
g2_begin(UpscaleNode.temp, false);
g2_begin(UpscaleNode.temp);
g2_draw_scaled_image(source, 0, 0, size1w, size1h);
g2_end();
@@ -96,7 +96,7 @@ class UpscaleNode extends LogicNode {
let tileSource = image_create_render_target(tileSize + 32 * 2, tileSize + 32 * 2);
for (let x = 0; x < Math.floor(size1w / tileSize); ++x) {
for (let y = 0; y < Math.floor(size1h / tileSize); ++y) {
g2_begin(tileSource, false);
g2_begin(tileSource);
g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, -source.width, source.height);
g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, source.width, -source.height);
g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, -source.width, -source.height);
@@ -106,7 +106,7 @@ class UpscaleNode extends LogicNode {
g2_draw_scaled_image(source, 32 - x * tileSize, 32 - y * tileSize, source.width, source.height);
g2_end();
let tileResult = UpscaleNode.doTile(tileSource);
g2_begin(result, false);
g2_begin(result);
g2_draw_sub_image(tileResult, x * tileSize2x, y * tileSize2x, 64, 64, tileSize2x, tileSize2x);
g2_end();
image_unload(tileResult);
+1 -1
View File
@@ -27,7 +27,7 @@ class VarianceNode extends LogicNode {
let strength = (VarianceNode.inst.inputs[1].node as any).value;
VarianceNode.inst.inputs[0].getAsImage((source: image_t) => {
g2_begin(VarianceNode.temp, false);
g2_begin(VarianceNode.temp);
g2_draw_scaled_image(source, 0, 0, 512, 512);
g2_end();