MCPcopy Create free account

hub / github.com/AmericanPresidentJimmyCarter/yasd-discord-bot / functions

Functions95 in github.com/AmericanPresidentJimmyCarter/yasd-discord-bot

↓ 15 callersFunctionshort_id_generator
()
src/util/__init__.py:671
↓ 10 callersFunctiondocument_to_pil
(doc)
src/util/__init__.py:194
↓ 6 callersFunctioncheck_subprompt_token_length
( prompt: str, )
src/util/__init__.py:133
↓ 6 callersFunctionmaybe_split_long_prompt_based_on_tokens
Attempt to break up a prompt that is too long by converting to tokens and then splitting the token lists into chunks and attempting to make t
src/util/__init__.py:220
↓ 5 callersFunctionprompt_un_parenthesis_un_comma
Handle parenthesis in slash command prompts.
src/serializers/__init__.py:25
↓ 5 callersFunctionresize_image
(img: Image, max_size: int)
src/util/__init__.py:352
↓ 4 callersFunctionbump_nonce_and_return
(user_image_generation_nonces: dict, user_id: str)
src/util/__init__.py:63
↓ 4 callersFunctioncheck_queue_and_maybe_write_to
( context: 'YASDClient', channel: discord.abc.GuildChannel, author_id: str, queue_message: str
src/util/__init__.py:90
↓ 4 callersFunctioncheck_restricted_to_channel
( context: 'YASDClient', channel: discord.abc.GuildChannel, )
src/util/__init__.py:122
↓ 4 callersFunctioncheck_user_joined_at
( hours_needed: int|None, channel: discord.abc.GuildChannel, user: discord.abc.User, )
src/util/__init__.py:157
↓ 4 callersFunctioncomplete_request
Complete a request for a user. If the user has a string in the queue (queue is not enable), it sets the value to False. If the user has a lis
src/util/__init__.py:174
↓ 4 callersMethodhandle_riff
(self, interaction: discord.Interaction, button: discord.ui.Button, idx: int, )
src/ui/four.py:221
↓ 4 callersMethodhandle_upscale
(self, interaction: discord.Interaction, button: discord.ui.Button, idx: int, )
src/ui/four.py:344
↓ 4 callersFunctionmono_gradient
( draw: ImageDraw, offset: int, sz: tuple[int, int], fr: int, to: int, horizontal: boo
src/util/__init__.py:264
↓ 4 callersFunctionsend_alert_embed
( channel: discord.abc.GuildChannel, author_id: str, work_msg: discord.Message, serialized_cmd
src/actions/__init__.py:47
↓ 4 callersFunctionspawn_image_tool_instance
The main handler for image generation. Spawns a new process which communicates to the flow instance through the gRPC and generates images,
src/util/__init__.py:697
↓ 4 callersFunctionto_discord_file_and_maybe_check_safety
( auto_spoiler: bool|None, img_loc: str, safety_feature_extractor: Callable|None, safety_check
src/util/__init__.py:805
↓ 3 callersMethodoriginal_image_sizes
(self)
src/ui/four.py:119
↓ 3 callersFunctionremove_quotes_from_cmd_kwargs
( cmd_kwargs: str, false_statement_to_include: Optional[list[str]]=None, )
src/serializers/__init__.py:4
↓ 3 callersFunctionseed_from_docarray_id
Retrieve a seed from a docarray ID and return it. If it is unset return None.
src/util/__init__.py:656
↓ 3 callersFunctiontile_with_upscaler_fn_and_reassemble
( img: Image, doc: Document, upscaler_fn: Callable, img_to_doc_fn: Callable, )
src/util/__init__.py:755
↓ 3 callersFunctiontweak_docarray_tags
(doc_arr: DocumentArray, key: str, val: Any)
src/util/__init__.py:780
↓ 3 callersFunctiontweak_docarray_tags_request
Load a DocArray, tweaks the request tag, then save it.
src/util/__init__.py:786
↓ 2 callersMethodfrom_serialized
Return a view from a serialized representation.
src/ui/one.py:155
↓ 2 callersFunctionimg_to_doc_fn
(_img: Image)
src/imagetool.py:467
↓ 2 callersMethodoriginal_image_sizes
(self)
src/ui/one.py:114
↓ 2 callersMethodserialize_to_json_and_store
Store a serialized representation in the global magic json.
src/ui/four.py:127
↓ 2 callersMethodserialize_to_json_and_store
Store a serialized representation in the global magic json.
src/ui/one.py:122
↓ 2 callersFunctionshuffle_by_lines_and_blur
( img: Image, sz: tuple[int], horizontal: bool=True, )
src/util/__init__.py:676
↓ 2 callersFunctionupscaler_fn
(_d: Document)
src/imagetool.py:477
↓ 2 callersFunctionwrite_button_store
(bs_filename: str, button_store_dict: dict)
src/util/__init__.py:819
↓ 1 callersFunctioncheck_safety
( img_loc: str, safety_feature_extractor: Callable, safety_checker: Callable, )
src/util/__init__.py:71
↓ 1 callersFunctionchunk
(lst, chunk_size)
src/util/__init__.py:226
↓ 1 callersFunctiongenerate_height_and_width_choices
Generate a list of choices in pixel sizes based on the user specified maximum height.
src/ui/choices.py:11
↓ 1 callersMethodhandle_retry
(self, interaction: discord.Interaction, button: discord.ui.Button, )
src/ui/four.py:283
↓ 1 callersMethodhandle_riff
(self, interaction: discord.Interaction, button: discord.ui.Button, )
src/ui/one.py:212
↓ 1 callersMethodhandle_upscale
(self, interaction: discord.Interaction, button: discord.ui.Button, )
src/ui/one.py:273
↓ 1 callersFunctionimage_grid
(imgs: list[Image], rows: int, cols:int)
src/util/__init__.py:199
↓ 1 callersFunctionimg_to_tensor
(img: Image)
src/util/__init__.py:208
↓ 1 callersFunctioninterpolate
(f_co, t_co, interval)
src/util/__init__.py:272
↓ 1 callersMethodoriginal_image_prompt
(self)
src/ui/four.py:111
↓ 1 callersMethodoriginal_image_prompt
(self)
src/ui/one.py:106
↓ 1 callersFunctionpreserve_transparency_resize
By default PIL resize destroys alpha channel information, so when doing a resize for an image mask through an alpha channel we have to do thi
src/util/__init__.py:284
↓ 1 callersFunctionprompt_contains_nsfw
( prompt: str, nsfw_toxic_detection_fn: Callable|None, nsfw_wordlist: list[str], )
src/util/__init__.py:303
↓ 1 callersFunctionprompt_has_valid_sd_custom_embeddings
Ensure all custom SD embeddings from huggingface are valid by checking their website. Cache the requests too.
src/util/__init__.py:336
↓ 1 callersFunctionresize_for_outpainting_modes
Resize an image an add a mask for outpainting. OUTPAINT_25_ALL = 'outpaint_25' OUTPAINT_25_LEFT = 'outpaint_25_l' OUTPAINT_25_RIGHT
src/util/__init__.py:388
↓ 1 callersFunctionresize_with_mask
Resize an image and add a mask to any empty portions that have been filled with noise. TODO: Remove as outriffing has been deprecated.
src/util/__init__.py:547
↓ 1 callersFunctionserialize_image_request
Serialize an image request to >image format.
src/serializers/__init__.py:38
↓ 1 callersFunctionserialize_interpolate_request
Serialize an interpolate request to >interpolate format.
src/serializers/__init__.py:139
↓ 1 callersFunctionserialize_riff_request
Serialize a riff request to >riff format.
src/serializers/__init__.py:79
↓ 1 callersFunctionserialize_upscale_request
Serialize an upscale request to '>upscale'.
src/serializers/__init__.py:190
↓ 1 callersFunctionstrip_square
Remove square brackets from a string.
src/util/__init__.py:724
↓ 1 callersFunctiontile_image
(img: Image, tile_width: int, tile_height: int)
src/util/__init__.py:741
Method__init__
( self, intents, button_store_dict=None, button_store_path: pathlib.Path=None,
src/client/__init__.py:25
Method__init__
( self, *, context: 'YASDClient|None'=None, idx_parent: int|float|None=None,
src/ui/four.py:63
Method__init__
( self, *, context: 'YASDClient|None'=None, idx_parent: int|float|None=None,
src/ui/one.py:59
Methodfrom_serialized
Return a view from a serialized representation.
src/ui/four.py:161
Functionimage
( interaction: discord.Interaction, prompt: str, height: Optional[app_commands.Choice[int]] = Non
src/bot.py:264
Functionimage
( channel: discord.abc.GuildChannel, user: discord.abc.User, context: 'YASDClient', prompt: s
src/actions/__init__.py:80
Functionimage2image
( interaction: discord.Interaction, url: str, prompt: str, height: Optional[app_commands.Cho
src/bot.py:393
Functioninterpolate
( interaction: discord.Interaction, prompt1: str, prompt2: str, height: Optional[app_commands
src/bot.py:496
Functioninterpolate
( channel: discord.abc.GuildChannel, user: discord.abc.User, context: 'YASDClient', prompt1:
src/actions/__init__.py:354
Methodlabels_for_map
(item)
src/ui/four.py:192
Methodlabels_for_map
(item)
src/ui/one.py:184
Functionon_message
The on_message handler exists for the sole purpose of letting users upload images to store and use to generate riffs as the old image2image p
src/bot.py:563
Functionon_ready
()
src/bot.py:1068
Methodon_submit
(modal_interaction: discord.Interaction)
src/ui/four.py:425
Methodon_submit
(modal_interaction: discord.Interaction)
src/ui/one.py:310
Functionprompt_check_fn
Check if a prompt is valid and return either the prompt or False if it is not valid.
src/bot.py:152
Methodprompt_editor_button
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:421
Methodprompt_editor_button
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/one.py:306
Functionresize_with_padding
"Outriffing" resize, where we add some noise while expanding the image and blend it in with a gradient.
src/util/__init__.py:593
Methodretry_button
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:390
Functionriff
( interaction: discord.Interaction, docarray_id: str, idx: app_commands.Range[int, 0, NUM_IMAGES_
src/bot.py:323
Functionriff
( channel: discord.abc.GuildChannel, user: discord.abc.User, context: 'YASDClient', docarray_
src/actions/__init__.py:213
Methodriff_button
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/one.py:293
Methodriff_button_0
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:366
Methodriff_button_1
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:372
Methodriff_button_2
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:396
Methodriff_button_3
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:402
Methodselect_aspect_ratio
(self, interaction: discord.Interaction, selection: discord.ui.Select)
src/ui/four.py:463
Methodselect_aspect_ratio
(self, interaction: discord.Interaction, selection: discord.ui.Select)
src/ui/one.py:348
Methodselect_strength
(self, interaction: discord.Interaction, selection: discord.ui.Select)
src/ui/four.py:520
Methodselect_strength
(self, interaction: discord.Interaction, selection: discord.ui.Select)
src/ui/one.py:405
Methodselect_upscaler
(self, interaction: discord.Interaction, selection: discord.ui.Select)
src/ui/four.py:554
Methodselect_upscaler
(self, interaction: discord.Interaction, selection: discord.ui.Select)
src/ui/one.py:439
Methodsetup_hook
(self)
src/client/__init__.py:51
Functionupscale
( interaction: discord.Interaction, docarray_id: str, idx: app_commands.Range[int, 0, NUM_IMAGES_M
src/bot.py:543
Functionupscale
( channel: discord.abc.GuildChannel, user: discord.abc.User, context: 'YASDClient', docarray_
src/actions/__init__.py:472
Methodupscale_button
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/one.py:299
Methodupscale_button_0
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:378
Methodupscale_button_1
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:384
Methodupscale_button_2
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:408
Methodupscale_button_3
(self, interaction: discord.Interaction, button: discord.ui.Button)
src/ui/four.py:414
Functionupscaler_fn_real
(_d: Document)
src/imagetool.py:497