ComfyUI Node: rjust

Class Name

Basic data handling: StringRjust

Category
Basic/STRING
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

rjust Description

StringRjust node right-aligns strings within a specified width, using customizable padding.

rjust:

The StringRjust node is designed to right-align a given string within a specified field width, providing a neat and organized appearance for text data. This node is particularly useful when you need to format strings to align them to the right, which can be beneficial in creating structured outputs or aligning text in tables and reports. By default, the node uses spaces to pad the string to the desired width, but you can customize the padding character to suit your specific needs. This flexibility allows you to maintain consistency in your text formatting, making it an essential tool for managing string data effectively.

rjust Input Parameters:

string

This parameter represents the input string that you want to right-align. It is the main text content that will be formatted by the node. The default value is an empty string "", which means if no string is provided, the node will not perform any alignment.

width

The width parameter specifies the total field width within which the input string should be right-aligned. It determines how much space the string will occupy after alignment. The default value is 10, with a minimum value of 0. If the specified width is less than the length of the input string, no padding will occur, and the string will remain unchanged.

fillchar

This optional parameter allows you to specify a character to use for padding the string to the desired width. By default, a space " " is used as the padding character. However, you can choose any single character to customize the appearance of the padded string. If more than one character is provided, only the first character will be used for padding.

rjust Output Parameters:

string

The output is a single string that has been right-aligned within the specified width. This formatted string will include the original input string, padded with the specified fillchar to achieve the desired alignment. The output is crucial for ensuring that text data is presented in a structured and visually appealing manner, especially in contexts where alignment is important.

rjust Usage Tips:

  • Use the width parameter to ensure that all strings in a list or table are aligned consistently, which can improve readability and presentation.
  • Customize the fillchar to match the style or theme of your project, such as using dots or dashes for a more decorative effect.
  • When working with strings of varying lengths, consider setting the width to the length of the longest string to maintain uniform alignment across all entries.

rjust Common Errors and Solutions:

Invalid fill character

  • Explanation: The fillchar parameter must be a single character. If you provide a string with more than one character, only the first character will be used.
  • Solution: Ensure that the fillchar is a single character. If you accidentally provide a longer string, be aware that only the first character will be applied for padding.

Width smaller than string length

  • Explanation: If the width specified is smaller than the length of the input string, the string will not be padded and will remain unchanged.
  • Solution: Set the width to a value greater than or equal to the length of the longest string you wish to align to ensure proper padding and alignment.

rjust Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

rjust