Tek Resimden Animasyonlu Sprite Sayfasına
Animasyonlu bir dizi oluşturmak için tek bir görsel yükleyin. İş akışı, oyunlarda veya animasyonlarda kullanılmak üzere birden çok kare içeren bir sprite sayfası oluşturur.
İş akışının içinde
Kaynak şablonun salt okunur önizlemesi. Düğümleri incelemek ve değişiklik yapmak için Cloud'da açın.
Loading the graph
Open full-size workflow previewŞurada çalışır
- Çıktı
- Görüntü
- Yazar
- Purz
Bu modeli kodunuzdan çağırın
Aşağıdaki istek, Playground ile aynı hazırlanmış grafiği ve ayarları kullanır. Her gönderim ücretli bir çalıştırma başlatabilir; sonucu bilinmeyen bir gönderimi otomatik olarak yeniden denemeyin.
What you need
- Runs on
- Comfy Cloud
- Anahtar
- COMFY_API_KEY
- Dosyalarınız
- Kod tarafından URL'lerinden yüklenir
Ücretli bir Cloud planı ve kredi gerektirir.
# 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)Bir örnek deneyin
Bu iş akışı hakkında
Bu ComfyUI iş akışı, 'Tek Görselden Animasyonlu Sprite Sheet', tek bir durağan görseli dinamik bir animasyonlu sprite sheet'e dönüştürür. Nano Banana 2 modeli kullanılarak, iş akışı gelişmiş AI yeteneklerinden yararlanır ve kullanıcı tanımlı istemlere göre görseli yorumlayıp animasyon haline getirir. SaveImage, LoadImage ve VHS_VideoCombine gibi temel düğümler, sorunsuz bir animasyon dizisi oluşturmak için birlikte çalışır. Ayrıca comfyui-kjnodes ve comfyui-rmbg gibi özel düğümler, arka planı kaldırma ve video karelerini verimli bir şekilde birleştirme gibi işlemlerle animasyon sürecini geliştirir. Bu iş akışı, özellikle oyun geliştiricileri ve animatörlerin durağan görsellerden hızlıca animasyonlu varlıklar üretmesi için faydalıdır.
Sorular ve yanıtlar
Yüksek çözünürlüklü, net konuya sahip ve arka plan gürültüsü az olan görseller, doğru ve akıcı animasyon için en iyi sonucu verir.
Evet, çıktı ihtiyacınıza göre kare sayısını ve animasyon türünü istem kutusunda belirtebilirsiniz.
Evet, iş akışında comfyui-rmbg düğümüyle arka plan kaldırma özelliği bulunur ve temiz, şeffaf bir çıktı sağlar.
Sprite sheet, SaveImageWithAlpha düğümüyle GIF ve WebM dahil olmak üzere çeşitli formatlarda kaydedilebilir.