<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_GRLIR_Resize</id>
	<title>Vapoursynth GRLIR Resize - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.selur.net/index.php?action=history&amp;feed=atom&amp;title=Vapoursynth_GRLIR_Resize"/>
	<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_GRLIR_Resize&amp;action=history"/>
	<updated>2026-11-19T05:56:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_GRLIR_Resize&amp;diff=542&amp;oldid=prev</id>
		<title>Selur: Update to current Hybrid behaviour; code as &lt;pre&gt; (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_GRLIR_Resize&amp;diff=542&amp;oldid=prev"/>
		<updated>2026-11-16T08:50:05Z</updated>

		<summary type="html">&lt;p&gt;Update to current Hybrid behaviour; code as &amp;lt;pre&amp;gt; (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:50, 16 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l35&quot;&gt;Line 35:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 35:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Example ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings on a 10-bit YUV 4:2:0 source (640x356), resized to 1280x712:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Default settings on a 10-bit YUV 4:2:0 source (640x356), resized to 1280x712:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight lang=&quot;python&quot;&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsGRLIR) - 640x360&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsGRLIR) - 640x360&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# adjusting color space from YUV420P10 to RGBS for vsGRLIR&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# adjusting color space from YUV420P10 to RGBS for vsGRLIR&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l45&quot;&gt;Line 45:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 45:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# resizing 2560x1424 to 1280x712&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# resizing 2560x1424 to 1280x712&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.fmtc.resample(clip, w=1280, h=712, kernel=&amp;quot;spline64&amp;quot;, interlaced=False, interlacedd=False)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;clip = core.fmtc.resample(clip, w=1280, h=712, kernel=&amp;quot;spline64&amp;quot;, interlaced=False, interlacedd=False)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== How Hybrid calls it ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
	<entry>
		<id>https://wiki.selur.net/index.php?title=Vapoursynth_GRLIR_Resize&amp;diff=442&amp;oldid=prev</id>
		<title>Selur: New filter page (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.selur.net/index.php?title=Vapoursynth_GRLIR_Resize&amp;diff=442&amp;oldid=prev"/>
		<updated>2026-11-15T08:04:40Z</updated>

		<summary type="html">&lt;p&gt;New filter page (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div style=&amp;quot;float:right; margin:0 0 1em 1em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;GRLIR&amp;#039;&amp;#039;&amp;#039; upscales with the super-resolution models of GRL, a transformer-based image restoration network that models image hierarchies at several scales. It is one of the resizers of [[Vapoursynth Resizer]], runs on an NVIDIA GPU through PyTorch and is slow.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Filtering → Vapoursynth → Frame → Resize&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Vapoursynth_GRLIRResize.png|none|GRLIR controls in Hybrid]]&lt;br /&gt;
&lt;br /&gt;
== What it does ==&lt;br /&gt;
Every frame is enlarged by the factor of the chosen model. &amp;#039;&amp;#039;Blind Image SR&amp;#039;&amp;#039; is meant for real-world degradations; the &amp;#039;&amp;#039;Classical Image SR&amp;#039;&amp;#039; models were trained on clean bicubic downscaling. Hybrid resizes the result to the exact output size afterwards.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
* Windows, Hybrid&amp;#039;s torch add-on and an NVIDIA GPU with CUDA.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Control !! Parameter !! Range / values !! Hybrid default !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| Model || model || Blind Image SR (4×), Classical Image SR (scale 2), (scale 3), (scale 4) || Blind Image SR || Network and upscale factor.&lt;br /&gt;
|-&lt;br /&gt;
| GPU ID || device_index || 0 – 4 || 0 || CUDA device.&lt;br /&gt;
|-&lt;br /&gt;
| Streams || num_streams || 1 – 64 || 1 || Number of CUDA streams.&lt;br /&gt;
|-&lt;br /&gt;
| Tile (x/y) || tile_w, tile_h || 0 – 8192 || 0 / 0 || Splits the frame into tiles to save GPU memory; 0 = no tiling.&lt;br /&gt;
|-&lt;br /&gt;
| Tile pad || tile_pad || 0 – 64 || 16 || Overlap of the tiles; only with tiling. Changing the model while tiling sets 16 (Blind) or 32 (Classical).&lt;br /&gt;
|-&lt;br /&gt;
| FP16 || – || on/off || off || Half precision (16-bit float clip); faster and needs less memory.&lt;br /&gt;
|-&lt;br /&gt;
| CUDA Graph || cuda_graphs || on/off || off || Uses CUDA graphs.&lt;br /&gt;
|-&lt;br /&gt;
| Resizer || – || point, rect, linear, cubic, lanczos, blackman, blackmanminlobe, spline36, spline64, spline144, spline, gauss, sinc || spline64 || Kernel that brings the result to the exact output size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Default settings on a 10-bit YUV 4:2:0 source (640x356), resized to 1280x712:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
clip = core.std.AddBorders(clip=clip, left=0, right=0, top=2, bottom=2) # add borders to achieve mod 8 (vsGRLIR) - 640x360&lt;br /&gt;
# adjusting color space from YUV420P10 to RGBS for vsGRLIR&lt;br /&gt;
clip = core.resize.Bicubic(clip=clip, format=vs.RGBS, matrix_in_s=&amp;quot;470bg&amp;quot;, range_in_s=&amp;quot;limited&amp;quot;, range_s=&amp;quot;full&amp;quot;)&lt;br /&gt;
# resizing using GRLIR&lt;br /&gt;
from vsgrlir import grlir&lt;br /&gt;
clip = grlir(clip, model=0) # scale: 4 - 2560x1440&lt;br /&gt;
clip = core.std.Crop(clip=clip, left=0, right=0, top=8, bottom=8) # removing added borders from mod requirement (vsGRLIR) -  2560x1424&lt;br /&gt;
# resizing 2560x1424 to 1280x712&lt;br /&gt;
clip = core.fmtc.resample(clip, w=1280, h=712, kernel=&amp;quot;spline64&amp;quot;, interlaced=False, interlacedd=False)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How Hybrid calls it ==&lt;br /&gt;
* Selected with Resize enabled and Resizer set to GRLIR (see [[Vapoursynth Resizer]]).&lt;br /&gt;
* The clip is converted to 32-bit float RGB (16-bit float with FP16) and padded to mod 8; afterwards the padding × the model&amp;#039;s factor is cropped.&lt;br /&gt;
* The output is input × the model&amp;#039;s factor (2, 3 or 4). If that differs from the target, fmtconv resizes it with the &amp;#039;&amp;#039;Resizer&amp;#039;&amp;#039; kernel to the exact size. With separately filtered fields the target height is halved.&lt;br /&gt;
* The model is always written, and so is the tile pad while tiling is on; GPU ID, streams, tiles and CUDA Graph only when they differ from the defaults.&lt;br /&gt;
* The restoration models of GRL (deblurring, denoising, JPEG) are in the separate GRLIR filter.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== GRL ===&lt;br /&gt;
GRL (Li et al., CVPR 2023, &amp;quot;Efficient and Explicit Modelling of Image Hierarchies for Image Restoration&amp;quot;) combines regional, local and global attention so that the network sees structure at several distances at once. The classical super-resolution models are the small variants; the blind model is a base-size network.&lt;br /&gt;
&lt;br /&gt;
=== vs-grlir ===&lt;br /&gt;
HolyWu&amp;#039;s vs-grlir runs GRL in VapourSynth with PyTorch. Without an explicit tile pad it uses 16 for the blind model and 32 for the classical ones.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
* [https://github.com/HolyWu/vs-grlir vs-grlir]&lt;br /&gt;
* [https://github.com/ofsoundof/GRL-Image-Restoration GRL]&lt;br /&gt;
* Hybrid&amp;#039;s tooltips&lt;br /&gt;
&lt;br /&gt;
[[Category:Vapoursynth Filters]]&lt;/div&gt;</summary>
		<author><name>Selur</name></author>
	</entry>
</feed>