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
File size: 1,098 Bytes
edb09f2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | class TextSplit:
def __init__(self):
pass
@classmethod
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,)
|