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 ConditionTextPrompts: | |
| def __init__(self): | |
| pass | |
| def INPUT_TYPES(s): | |
| return { | |
| "required": { | |
| "clip": ("CLIP",), | |
| "positive": ( | |
| "STRING", | |
| {"default": "", "multiline": False, "forceInput": True}, | |
| ), | |
| "negative": ( | |
| "STRING", | |
| {"default": "", "multiline": False, "forceInput": True}, | |
| ), | |
| }, | |
| } | |
| RETURN_TYPES = ( | |
| "CLIP", | |
| "CONDITIONING", | |
| "CONDITIONING", | |
| ) | |
| RETURN_NAMES = ( | |
| "CLIP", | |
| "positive", | |
| "negative", | |
| ) | |
| FUNCTION = "conditiontext" | |
| CATEGORY = "Chibi-Nodes/Text" | |
| def conditiontext(self, clip, positive, negative,): | |
| returnedcond = [] | |
| positive_raw = clip.tokenize(positive) | |
| positive_cond, positive_pooled = clip.encode_from_tokens( | |
| positive_raw, return_pooled=True | |
| ) | |
| returnedcond.append( | |
| [[positive_cond, {"pooled_output": positive_pooled}]]) | |
| negative_raw = clip.tokenize(negative) | |
| negative_cond, negative_pooled = clip.encode_from_tokens( | |
| negative_raw, return_pooled=True | |
| ) | |
| returnedcond.append( | |
| [[negative_cond, {"pooled_output": negative_pooled}]]) | |
| return ( | |
| clip, | |
| returnedcond[0], | |
| returnedcond[1], | |
| ) | |