Instructions to use bbbboiwow/cocccck with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use bbbboiwow/cocccck with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("bbbboiwow/cocccck", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| class TextSplit: | |
| def __init__(self): | |
| pass | |
| def INPUT_TYPES(s): | |
| return { | |
| "required": { | |
| "text": ( | |
| "STRING", | |
| {"default": "", "forceInput": True}, | |
| ), | |
| "separator": ( | |
| "STRING", | |
| {"default": "."}, | |
| ), | |
| "reverse": ([False, True],), | |
| "return_half": (["First Half", "Second Half"],), | |
| }, | |
| } | |
| RETURN_TYPES = ("STRING",) | |
| RETURN_NAMES = ("text",) | |
| OUTPUT_NODE = True | |
| FUNCTION = "do_split" | |
| CATEGORY = "Chibi-Nodes/Text" | |
| def do_split(self, text, separator, reverse, return_half): | |
| if reverse: | |
| text = text.rsplit(separator, 1) | |
| else: | |
| text = text.split(separator, 1) | |
| if len(text) == 2: | |
| if return_half == "First Half": | |
| text = text[0] | |
| if return_half == "Second Half": | |
| text = text[1] | |
| return (text,) | |