-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add gallery component doc * wording * Apply suggestions from code review Co-authored-by: Victor Muštar <[email protected]> * dark mode images * Update model-cards-components.md --------- Co-authored-by: Victor Muštar <[email protected]>
- Loading branch information
1 parent
417d8d6
commit d3c9d81
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Model Card components | ||
|
||
**Model Card Components** are special elements that you can inject directly into your Model Card markdown to display powerful custom components in your model page. These components are authored by us, feel free to share ideas about new Model Card component in [this discussion](https://huggingface.co/spaces/huggingchat/chat-ui/discussions/312). | ||
|
||
## The Gallery component | ||
|
||
Add the `<Gallery />` component to your text-to-image model card to showcase your images generation. | ||
|
||
For example, | ||
```md | ||
|
||
<Gallery /> | ||
|
||
## Model description | ||
|
||
TintinIA is fine-tuned version of Stable-Diffusion-xl trained on 125 comics panels from Tintin album. | ||
|
||
``` | ||
|
||
|
||
<div class="flex justify-center"> | ||
<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gallery.png"/> | ||
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gallery-dark.png"/> | ||
</div> | ||
|
||
The `<Gallery/>` component will use your Model Card [widget metadata](/docs/hub/models-widgets-examples#text-to-image) to display the images with each associated prompt. | ||
|
||
```yaml | ||
widget: | ||
- text: "drawing of tintin in a shop" | ||
output: | ||
url: "images/shop.png" | ||
- text: "drawing of tintin watching rugby" | ||
output: | ||
url: "images/rugby.png" | ||
parameters: | ||
negative_prompt: "blurry" | ||
- text: "tintin working at the office" | ||
output: | ||
url: "images/office.png" | ||
``` | ||
> Hint: Support of Card Components through the GUI editor coming soon... |