Image unique vers feuille de sprites animée
Téléversez une seule image pour générer une séquence animée. Le flux de travail crée une feuille de sprites avec plusieurs images pour une utilisation dans des jeux ou des animations.
Dans le workflow
Un aperçu en lecture seule du modèle source. Ouvrez-le dans Cloud pour explorer les nœuds et apporter des modifications.
Loading the graph
Open full-size workflow previewS’exécute sur
- Sortie
- Image
- Auteur
- Purz
Appelez ce modèle depuis votre code
La requête ci-dessous utilise le même graphe préparé et les mêmes paramètres que le Playground. Chaque envoi peut lancer une exécution payante ; ne relancez pas automatiquement un envoi dont l’issue est inconnue.
What you need
- Runs on
- Comfy Cloud
- Clé
- COMFY_API_KEY
- Vos fichiers
- Importés par le code depuis leurs URL
Nécessite un forfait Cloud payant et des crédits.
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"2": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/spritesheet_output",
"images": [
"98",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"14": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"57": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_01",
"images": [
"93:32",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"58": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_02",
"images": [
"93:45",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"59": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_03",
"images": [
"93:46",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"61": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_04",
"images": [
"93:48",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"64": {
"class_type": "SaveImageWithAlpha",
"inputs": {
"filename_prefix": "sprite_sheet/spritesheet_mask",
"images": [
"93:86",
0
],
"mask": [
"93:86",
1
]
},
"_meta": {
"title": "Save Image With Alpha"
}
},
"74": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_05",
"images": [
"93:70",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"75": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_06",
"images": [
"93:71",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"76": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_07",
"images": [
"93:72",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"77": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "sprite_sheet/frame_08",
"images": [
"93:73",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"82": {
"class_type": "VHS_VideoCombine",
"inputs": {
"dither": "sierra2_4a",
"filename_prefix": "sprite_sheet/animation",
"format": "video/ffmpeg-gif",
"frame_rate": 8,
"images": [
"93:81",
0
],
"loop_count": 0,
"pingpong": False,
"save_output": True
},
"_meta": {
"title": "Video Combine 🎥🅥🅗🅢"
}
},
"87": {
"class_type": "VHS_VideoCombine",
"inputs": {
"filename_prefix": "sprite_sheet/animation",
"format": "image/webp",
"frame_rate": 8,
"images": [
"93:81",
0
],
"loop_count": 0,
"lossless": True,
"pingpong": False,
"save_output": True
},
"_meta": {
"title": "Video Combine 🎥🅥🅗🅢"
}
},
"98": {
"class_type": "GeminiNanoBanana2",
"inputs": {
"aspect_ratio": "16:9",
"images": [
"14",
0
],
"model": "Nano Banana 2 (Gemini 3.1 Flash Image)",
"prompt": "pixelart, 32x32 pixels sprite sheet, white background, 4 x 2 grid of images\n\na cheerful jump-and-wave animation cycle for this character, eight frames read left to right and top to bottom: crouching low to gather energy, springing upward with both arms stretched high, reaching the top of the jump with a big open-mouthed smile, waving one paw at the viewer while floating, starting to fall with fur fluffing upward, landing softly with knees bent, bouncing back up to standing, and settling into a happy idle pose. Same character, same colours, same scale and same position in every cell, crisp pixel edges, no text.",
"resolution": "2K",
"response_modalities": "IMAGE",
"seed": 804086386519426,
"system_prompt": "You are an expert image-generation engine. You must ALWAYS produce an image.\nInterpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition.\nIf a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept.\nPrioritize generating the visual representation above any text, formatting, or conversational requests.",
"thinking_level": "HIGH"
},
"_meta": {
"title": "Nano Banana 2"
}
},
"93:32": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:41",
0
],
"image": [
"93:86",
0
],
"left": 0,
"right": [
"93:33",
0
],
"top": 0
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:33": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"93:34",
0
],
"b": 0,
"value": "a / 4"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"93:34": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"98",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"93:37": {
"class_type": "SplitImageWithAlpha",
"inputs": {
"image": [
"98",
0
]
},
"_meta": {
"title": "Split Image with Alpha"
}
},
"93:38": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"93:33",
0
],
"b": [
"93:33",
0
],
"value": "a + b"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"93:39": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"93:38",
0
],
"b": [
"93:33",
0
],
"value": "a + b"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"93:41": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"93:34",
1
],
"b": 0,
"value": "a / 2"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"93:45": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:41",
0
],
"image": [
"93:86",
0
],
"left": [
"93:33",
0
],
"right": [
"93:38",
0
],
"top": 0
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:46": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:41",
0
],
"image": [
"93:86",
0
],
"left": [
"93:38",
0
],
"right": [
"93:39",
0
],
"top": 0
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:48": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:41",
0
],
"image": [
"93:86",
0
],
"left": [
"93:39",
0
],
"right": [
"93:53",
0
],
"top": 0
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:53": {
"class_type": "SimpleMath+",
"inputs": {
"a": [
"93:39",
0
],
"b": [
"93:33",
0
],
"value": "a + b"
},
"_meta": {
"title": "🔧 Simple Math"
}
},
"93:65": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"93:33",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"93:66": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"93:38",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"93:67": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"93:39",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"93:68": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"93:53",
0
]
},
"_meta": {
"title": "Preview as Text"
}
},
"93:70": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:34",
1
],
"image": [
"93:86",
0
],
"left": 0,
"right": [
"93:33",
0
],
"top": [
"93:41",
0
]
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:71": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:34",
1
],
"image": [
"93:86",
0
],
"left": [
"93:33",
0
],
"right": [
"93:38",
0
],
"top": [
"93:41",
0
]
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:72": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:34",
1
],
"image": [
"93:86",
0
],
"left": [
"93:38",
0
],
"right": [
"93:39",
0
],
"top": [
"93:41",
0
]
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:73": {
"class_type": "Image Crop Location",
"inputs": {
"bottom": [
"93:34",
1
],
"image": [
"93:86",
0
],
"left": [
"93:39",
0
],
"right": [
"93:53",
0
],
"top": [
"93:41",
0
]
},
"_meta": {
"title": "Image Crop Location"
}
},
"93:81": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"93:32",
0
],
"images.image1": [
"93:45",
0
],
"images.image2": [
"93:46",
0
],
"images.image3": [
"93:48",
0
],
"images.image4": [
"93:70",
0
],
"images.image5": [
"93:71",
0
],
"images.image6": [
"93:72",
0
],
"images.image7": [
"93:73",
0
]
},
"_meta": {
"title": "Batch Images"
}
},
"93:86": {
"class_type": "BiRefNetRMBG",
"inputs": {
"background": "Alpha",
"background_color": "#222222",
"image": [
"93:37",
0
],
"invert_output": False,
"mask_blur": 0,
"mask_offset": -4,
"model": "BiRefNet_toonout",
"refine_foreground": False
},
"_meta": {
"title": "BiRefNet (RMBG)"
}
}
})
workflow.set_input("14", "image", client.assets.from_url("https://comfy.org/catalog-media/13770c7a-be67-46ba-99a9-780ff44cf0c8/5594c7b2-396e-4557-8e48-3d0ce775da7e"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("2"):
output.to_file(output.name)
for output in job.get_outputs("87"):
output.to_file(output.name)
for output in job.get_outputs("82"):
output.to_file(output.name)
for output in job.get_outputs("64"):
output.to_file(output.name)
for output in job.get_outputs("57"):
output.to_file(output.name)
for output in job.get_outputs("58"):
output.to_file(output.name)
for output in job.get_outputs("59"):
output.to_file(output.name)
for output in job.get_outputs("61"):
output.to_file(output.name)
for output in job.get_outputs("74"):
output.to_file(output.name)
for output in job.get_outputs("75"):
output.to_file(output.name)
for output in job.get_outputs("76"):
output.to_file(output.name)
for output in job.get_outputs("77"):
output.to_file(output.name)Essayer un exemple
À propos de ce workflow
Ce workflow ComfyUI, intitulé « Image unique vers sprite sheet animée », transforme une image statique en sprite sheet animée dynamique. Utilisant le modèle Nano Banana 2, il exploite des capacités IA avancées pour interpréter et animer l’image selon l’invite de l’utilisateur. Les nœuds clés SaveImage, LoadImage et VHS_VideoCombine collaborent pour créer une séquence d’animation fluide. Le workflow intègre aussi des nœuds personnalisés comme comfyui-kjnodes et comfyui-rmbg pour améliorer l’animation en supprimant l’arrière-plan et en combinant efficacement les images vidéo. Ce workflow est particulièrement utile pour les développeurs de jeux et animateurs souhaitant générer rapidement des assets animés à partir d’images statiques.
Questions-réponses
Des images haute résolution avec un sujet clair et peu de bruit d’arrière-plan assurent une animation précise et fluide.
Oui, vous pouvez spécifier le nombre d’images et le type d’animation dans la zone d’invite pour adapter la sortie à vos besoins.
Oui, le workflow inclut la suppression d’arrière-plan via le nœud comfyui-rmbg, garantissant une sortie propre et transparente.
La sprite sheet peut être enregistrée dans plusieurs formats, dont GIF et WebM, via le nœud SaveImageWithAlpha.
Workflows associés
- Nano Banana Pro, Gemini3 Pro Image Preview, Google
Create a character turnaround
- Qwen-Image-Edit
Change a material
- Qwen-Image-Edit
See your subject from a new angle
- Flux.2 Dev, Flux
Create a product mockup
- Nano Banana Pro
Try an outfit on a character
- Seedream
Put your product in a new scene
- SSeedVR2
Upscale and restore detail
- Nano Banana Pro
Sharpen a product photo
- Topaz
Upscale an illustration
- HHitPaw
Restore portrait detail
- FLUX.1 Fill
Edit a selected region
- FLUX.1 Fill
Extend an image’s borders