Twig template print all comments but not the comment form For context:
in my template file node--some-node.html.twig i have a grid of items which have a custom comment form on them. The form creates a comment through an API. The form passes the ID of the grid item it is under to the API and the created comment then has a field_profile_id with the item's id in it. Now, in the template file I need to output JUST the comments that belong to that grid item.

When I write this into the template file:
    {{ content.field_comments }}
i get the output of all the comments that belong to this node and underneath I get the comment form (which I don't need). Ideally I would like to do everything in the same template file, so I could do something like this:

{% if entity.nid.value == content.field_comments.someComment.field_profile_id %} 
{# output the comment here #}
{% endif %}


Here the entity.nid.value is the node id of the grid items I was talking about earlier.

EDIT:
Theoretically what I need to do is:


Iterate through all possible comments for this node.
Check if comment has some ID value (that a grid item might have)
If the IDs match, print out the comment, if it doesn't skip it
You must add a file to your template called

field--comment.html.twig

Use the following code.

{#
/**
 * @file
 * Theme override for comment fields.
 *
 * Available variables:
 * - attributes: HTML attributes for the containing element.
 * - label_hidden: Whether to show the field label or not.
 * - title_attributes: HTML attributes for the title.
 * - label: The label for the field.
 * - title_prefix: Additional output populated by modules, intended to be
 *   displayed in front of the main title tag that appears in the template.
 * - title_suffix: Additional title output populated by modules, intended to
 *   be displayed after the main title tag that appears in the template.
 * - comments: List of comments rendered through comment.html.twig.
 * - comment_form: The 'Add new comment' form.
 * - comment_display_mode: Is the comments are threaded.
 * - comment_type: The comment type bundle ID for the comment field.
 * - entity_type: The entity type to which the field belongs.
 * - field_name: The name of the field.
 * - field_type: The type of the field.
 * - label_display: The display settings for the label.
 *
 * @see template_preprocess_field()
 * @see comment_preprocess_field()
 */
#}
{%
  set classes = [
    'field',
    'field--name-' ~ field_name|clean_class,
    'field--type-' ~ field_type|clean_class,
    'field--label-' ~ label_display,
    'comment-wrapper',
  ]
%}
{%
  set title_classes = [
    'title',
    label_display == 'visually_hidden' ? 'visually-hidden',
  ]
%}
&lt;section{{ attributes.addClass(classes) }}&gt;
  {% if comments and not label_hidden %}
    {{ title_prefix }}
    &lt;h2{{ title_attributes.addClass(title_classes) }}&gt;{{ label }}&lt;/h2&gt;
    {{ title_suffix }}
  {% endif %}

  {{ comments }}

  {% if comment_form %}
    &lt;h2 class='title comment-form__title'&gt;{{ 'Add new comment'|t }}&lt;/h2&gt;
    {{ comment_form }}
  {% endif %}

&lt;/section&gt;